@font-face {
  font-family: "CastorTwoMGNE";
  src: url("../assets/fonts/CASTOR TWO W01 REGULAR.TTF") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "LoraMGNE";
  src: url("../assets/fonts/LORA-REGULAR.TTF") format("truetype");
  font-weight: 400;
  font-style: normal;
}
.application.mgne,
.mgne-chat-card {
  --mgne-bg: #1b1512;
  --mgne-panel: rgba(41, 30, 24, 0.88);
  --mgne-panel-soft: rgba(64, 47, 37, 0.66);
  --mgne-border: rgba(171, 139, 104, 0.35);
  --mgne-border-strong: rgba(196, 154, 69, 0.42);
  --mgne-accent: #dd6b2d;
  --mgne-accent-alt: #4f7d73;
  --mgne-text: #ccb292;
  --mgne-text-soft: #7e664f;
  --mgne-title: #ab8b68;
  --mgne-shadow: 0 14px 30px rgba(0, 0, 0, 0.36);
}
.application.mgne {
  font-family: "LoraMGNE", "Book Antiqua", serif;
  line-height: 1.45;
  color: #ccb292;
}
.application.mgne .window-header {
  background: linear-gradient(90deg, rgba(127, 29, 23, 0.4), rgba(183, 70, 31, 0.18) 25%, transparent 70%), linear-gradient(180deg, color-mix(in srgb, #1b1512 80%, black), #13100f);
  border-bottom: 1px solid rgba(196, 154, 69, 0.35);
  color: #ab8b68;
}
.application.mgne .window-header .window-title {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
  text-shadow: 0 0 16px rgba(221, 107, 45, 0.25);
}
.application.mgne .window-header .header-control {
  font-family: var(--font-awesome, "Font Awesome 6 Pro");
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
}
.application.mgne .window-header .header-control::before,
.application.mgne .window-header i[class^="fa"],
.application.mgne .window-header i[class*=" fa"] {
  font-family: inherit;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
}
.application.mgne .window-header .header-control.fa-solid,
.application.mgne .window-header .header-control.fas,
.application.mgne .window-header .fa-solid,
.application.mgne .window-header .fas {
  font-weight: 900;
}
.application.mgne .window-header .header-control.fa-regular,
.application.mgne .window-header .header-control.far,
.application.mgne .window-header .fa-regular,
.application.mgne .window-header .far {
  font-weight: 400;
}
.application.mgne .window-content {
  background: radial-gradient(circle at top left, rgba(183, 70, 31, 0.12), transparent 28%), radial-gradient(circle at top right, rgba(79, 125, 115, 0.1), transparent 24%), linear-gradient(180deg, rgba(27, 21, 18, 0.3), rgba(19, 16, 15, 0.28)), url("../assets/ui/page_background.webp") center top / cover no-repeat, linear-gradient(180deg, #1b1512, #13100f 120%);
  color: #ccb292;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.application.mgne.character .window-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.application.mgne *,
.mgne-chat-card * {
  box-sizing: border-box;
}
.application.mgne input,
.application.mgne select,
.application.mgne textarea,
.application.mgne button,
.application.mgne label,
.application.mgne p,
.application.mgne span,
.application.mgne small,
.mgne-chat-card {
  font-family: "LoraMGNE", "Book Antiqua", serif;
  line-height: 1.45;
}
.application.mgne input,
.application.mgne select,
.application.mgne textarea {
  width: 100%;
  border: 1px solid rgba(171, 139, 104, 0.22);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 60%), rgba(17, 12, 10, 0.72);
  color: #ccb292;
  padding: 0.4rem 0.52rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.application.mgne input:focus,
.application.mgne select:focus,
.application.mgne textarea:focus {
  outline: none;
  border-color: rgba(221, 107, 45, 0.7);
  box-shadow: 0 0 0 1px rgba(221, 107, 45, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.application.mgne select {
  appearance: none;
  padding-right: 1.3rem;
  background-image: linear-gradient(45deg, transparent 50%, rgba(196, 154, 69, 0.78) 50%), linear-gradient(135deg, rgba(196, 154, 69, 0.78) 50%, transparent 50%), linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 60%);
  background-position: calc(100% - 11px) calc(50% - 2px), calc(100% - 7px) calc(50% - 2px), 0 0;
  background-size: 4px 4px, 4px 4px, auto;
  background-repeat: no-repeat;
}
.application.mgne textarea {
  min-height: 4.5rem;
  resize: vertical;
}
.application.mgne button {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(196, 154, 69, 0.44);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(221, 107, 45, 0.2), rgba(127, 29, 23, 0.1)), linear-gradient(135deg, rgba(171, 139, 104, 0.1), transparent 40%), rgba(17, 12, 10, 0.72);
  color: #ccb292;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 14px rgba(0, 0, 0, 0.2);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, color 120ms ease;
  padding: 0.34rem 0.72rem;
}
.application.mgne button:hover,
.application.mgne button:focus {
  border-color: rgba(221, 107, 45, 0.7);
  color: #d9c6ae;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 18px rgba(127, 29, 23, 0.26);
}
.application.mgne label {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6e3d2a;
  font-size: 0.74rem;
}
.application.mgne fieldset {
  background: linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 24%), linear-gradient(135deg, rgba(183, 70, 31, 0.08), transparent 40%), linear-gradient(180deg, rgba(27, 21, 18, 0.52), rgba(19, 16, 15, 0.34)), url("../assets/ui/page_background.webp") center center / cover no-repeat, linear-gradient(180deg, rgba(41, 30, 24, 0.88) 0%, color-mix(in srgb, rgba(41, 30, 24, 0.88) 88%, black) 100%);
  border: 1px solid rgba(171, 139, 104, 0.34);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 236, 203, 0.08), inset 0 0 0 1px rgba(255, 236, 203, 0.03);
  position: relative;
  margin: 0;
}
.application.mgne fieldset::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(196, 154, 69, 0.16);
  border-radius: calc(8px - 4px);
}
.application.mgne legend {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c49a45;
  display: inline-block;
  position: relative;
  top: 0.12rem;
  font-size: 0.82rem;
  line-height: 1.1;
  padding: 0.04rem 0.32rem;
}
.application.mgne code,
.mgne-chat-card code {
  font-family: "Courier New", monospace;
  background: rgba(19, 16, 15, 0.75);
  color: #ab8b68;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}
.application.mgne .empty-state {
  color: rgba(95, 77, 64, 0.94);
  font-style: italic;
  letter-spacing: 0.03em;
}
.application.mgne .rollable {
  color: #dd6b2d;
  text-shadow: 0 0 12px rgba(183, 70, 31, 0.18);
}
.application.mgne .rollable:hover {
  color: #e48a59;
}
#combat .combat-controls .mgne-flee-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2rem;
  margin-top: 0.35rem;
  border: 1px solid rgba(196, 154, 69, 0.28);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(127, 29, 23, 0.26), rgba(183, 70, 31, 0.14)), rgba(17, 12, 10, 0.92);
  color: #ab8b68;
  font-family: "LoraMGNE", "Book Antiqua", serif;
  font-weight: 700;
}
#combat .combat-controls .mgne-flee-control:hover:not(:disabled) {
  border-color: rgba(221, 107, 45, 0.52);
  color: #b69a7c;
}
#combat .combat-controls .mgne-flee-control:disabled {
  opacity: 0.5;
}
.application.mgne .mgne-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.application.mgne.character .mgne-sheet-header {
  flex: 0 0 auto;
}
.application.mgne .sheet-header {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 0.8rem;
  align-items: start;
}
.application.mgne.item-sheet .sheet-header {
  grid-template-columns: 111px 1fr;
}
.application.mgne .actor-portrait,
.application.mgne .item-portrait {
  width: 100%;
  max-width: 148px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(196, 154, 69, 0.4);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34), inset 0 0 0 2px rgba(204, 178, 146, 0.08);
  background: radial-gradient(circle at 30% 20%, rgba(171, 139, 104, 0.08), transparent 30%), rgba(17, 12, 10, 0.72);
}
.application.mgne.item-sheet .item-portrait {
  max-width: 111px;
}
.application.mgne .header-fields,
.application.mgne .resource-bar,
.application.mgne .ability-grid,
.application.mgne .inventory-section,
.application.mgne .daily-resources-panel,
.application.mgne .tab-panel {
  background: linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 24%), linear-gradient(135deg, rgba(183, 70, 31, 0.08), transparent 40%), linear-gradient(180deg, rgba(27, 21, 18, 0.52), rgba(19, 16, 15, 0.34)), url("../assets/ui/page_background.webp") center center / cover no-repeat, linear-gradient(180deg, rgba(41, 30, 24, 0.88) 0%, color-mix(in srgb, rgba(41, 30, 24, 0.88) 88%, black) 100%);
  border: 1px solid rgba(171, 139, 104, 0.34);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 236, 203, 0.08), inset 0 0 0 1px rgba(255, 236, 203, 0.03);
  position: relative;
  padding: 0.65rem;
}
.application.mgne .header-fields::before,
.application.mgne .resource-bar::before,
.application.mgne .ability-grid::before,
.application.mgne .inventory-section::before,
.application.mgne .daily-resources-panel::before,
.application.mgne .tab-panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(196, 154, 69, 0.16);
  border-radius: calc(8px - 4px);
}
.application.mgne .resource-bar,
.application.mgne .ability-grid,
.application.mgne .grid.two,
.application.mgne .grid.three,
.application.mgne .condition-value-grid,
.application.mgne .condition-flag-grid {
  display: grid;
  gap: 0.5rem;
}
.application.mgne .resource-bar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.application.mgne .resource-bar-core {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.application.mgne .resource-bar-daily {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.application.mgne .resource-bar-equipment {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.application.mgne .ability-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.application.mgne .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.application.mgne .grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.application.mgne.item-sheet .item-form-grid {
  display: grid;
  gap: 0.65rem 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.application.mgne.item-sheet .item-form-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.application.mgne.item-sheet .item-form-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.application.mgne.item-sheet .item-form-row {
  display: grid;
  grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.application.mgne.item-sheet .item-form-row > label {
  margin: 0;
  line-height: 1.1;
  min-width: 0;
}
.application.mgne.item-sheet .item-form-row > input,
.application.mgne.item-sheet .item-form-row > select {
  width: 100%;
  min-width: 0;
}
.application.mgne .condition-value-grid {
  grid-template-columns: max-content 1fr;
  align-items: center;
  margin-bottom: 0.6rem;
}
.application.mgne .condition-flag-grid {
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.3rem 0.6rem;
}
.application.mgne .resource-box,
.application.mgne .ability-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.52rem;
  border-radius: 8px;
  border: 1px solid rgba(82, 69, 60, 0.3);
  background: linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 30%), linear-gradient(180deg, rgba(183, 70, 31, 0.07), transparent 80%), rgba(64, 47, 37, 0.66);
}
.application.mgne .ability-card {
  min-height: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.38rem 0.46rem;
}
.application.mgne .resource-box-track,
.application.mgne .resource-box-single {
  justify-content: space-between;
}
.application.mgne .resource-box-compact {
  gap: 0.18rem;
  padding: 0.36rem 0.42rem;
}
.application.mgne .resource-box-compact > label {
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  color: #ab8b68;
}
.application.mgne .resource-box-inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.application.mgne .resource-box-inline > label {
  flex: 0 0 auto;
  margin: 0;
}
.application.mgne .resource-box-inline .resource-track,
.application.mgne .resource-box-inline .numeric-pill {
  flex: 1 1 auto;
}
.application.mgne .resource-box-inline-track {
  align-items: flex-start;
}
.application.mgne .resource-box-inline-track > label {
  padding-top: 1rem;
}
.application.mgne .resource-box-inline-track .numeric-caption {
  color: #6e3d2a;
}
.application.mgne .resource-box-inline-track .numeric-caption-strong {
  padding: 0.08rem 0.34rem;
  border-radius: 999px;
  background: rgba(196, 154, 69, 0.18);
  border: 1px solid rgba(110, 61, 42, 0.28);
  color: #5f3524;
  font-size: 0.6rem;
  letter-spacing: 0.11em;
}
.application.mgne .resource-box-inline-track .numeric-cluster {
  align-items: center;
}
.application.mgne .resource-box-inline-track .numeric-input {
  width: 3.4rem;
  min-width: 3.4rem;
}
.application.mgne .resource-box-inline-single .numeric-pill {
  flex: 0 0 auto;
}
.application.mgne .resource-box-inline-single .numeric-input {
  width: 3.2rem;
  min-width: 3.2rem;
}
.application.mgne .header-resource {
  align-self: stretch;
}
.application.mgne .header-resource .resource-box {
  height: 100%;
}
.application.mgne .resource-track {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.32rem;
  align-items: end;
}
.application.mgne .resource-track-die {
  grid-template-columns: 1fr 1fr;
}
.application.mgne .numeric-cluster {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.application.mgne .numeric-caption {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(129, 83, 59, 0.94);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}
.application.mgne .resource-box-compact .numeric-caption {
  font-size: 0.52rem;
  letter-spacing: 0.09em;
}
.application.mgne .track-separator {
  align-self: center;
  color: rgba(196, 154, 69, 0.72);
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 1rem;
  line-height: 1;
}
.application.mgne .numeric-input {
  min-width: 0;
  text-align: center;
  text-align-last: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1rem;
  padding-inline: 0.2rem;
}
.application.mgne .resource-box-compact .numeric-input,
.application.mgne .resource-box-compact .compact-select {
  min-height: 30px;
  padding: 0.18rem 0.16rem;
  font-size: 0.9rem;
}
.application.mgne .numeric-input-readonly {
  color: #ab8b68;
}
.application.mgne .compact-select {
  text-align: center;
  text-align-last: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding-inline: 0.35rem;
}
.application.mgne .numeric-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 154, 69, 0.18);
  background: rgba(17, 12, 10, 0.64);
}
.application.mgne .resource-box-compact .numeric-pill {
  padding: 0.1rem;
}
.application.mgne .numeric-pill-suffix {
  gap: 0.35rem;
  justify-content: space-between;
}
.application.mgne .numeric-suffix {
  flex: 0 0 auto;
  color: #c49a45;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.application.mgne .resource-meta {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 0.12rem;
  padding: 0.16rem 0.44rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 125, 115, 0.2);
  color: #7caca2;
  background: rgba(79, 125, 115, 0.1);
  font-size: 0.72rem;
}
.application.mgne .resource-box-compact .resource-track {
  gap: 0.22rem;
}
.application.mgne .resource-box-compact .numeric-cluster {
  gap: 0.1rem;
}
.application.mgne .resource-box-compact .track-separator {
  font-size: 0.88rem;
}
.application.mgne .resource-box-compact .resource-meta {
  margin-top: 0.06rem;
  padding: 0.1rem 0.34rem;
  font-size: 0.64rem;
}
.application.mgne .resource-inline {
  display: flex;
  gap: 0.32rem;
  align-items: center;
}
.application.mgne .resource-inline span {
  color: #7e664f;
}
.application.mgne .sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 0 0 auto;
  justify-content: center;
}
.application.mgne .tab-button {
  min-width: 110px;
}
.application.mgne .tab-button.active {
  border-color: rgba(221, 107, 45, 0.7);
  background: linear-gradient(180deg, rgba(221, 107, 45, 0.26), rgba(127, 29, 23, 0.12)), linear-gradient(135deg, rgba(204, 178, 146, 0.12), transparent 45%), rgba(17, 12, 10, 0.72);
  color: #d6c1a7;
}
.application.mgne .tab-panel:not(.active) {
  display: none;
}
.application.mgne.character .tab-panel.active {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.application.mgne .inventory-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.application.mgne .daily-resources-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.application.mgne .section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.application.mgne .section-heading h2 {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: #ab8b68;
  font-size: 0.9rem;
}
.application.mgne .section-heading small {
  display: inline-block;
  margin-top: 0.12rem;
  color: #7e664f;
  font-size: 0.72rem;
}
.application.mgne .inventory-header,
.application.mgne .inline-buttons,
.application.mgne .item-actions,
.application.mgne .sheet-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.application.mgne .resource-box-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.12rem;
}
.application.mgne .resonation-blocked-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.2rem;
  padding: 0.28rem 0.5rem;
  border-radius: 4px;
  background: rgba(180, 40, 20, 0.22);
  border-left: 3px solid rgba(220, 80, 40, 0.7);
  color: #e69062;
  font-size: 0.73rem;
}
.application.mgne .resonation-blocked-banner .btn-clear-block {
  flex-shrink: 0;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  cursor: pointer;
}
.application.mgne .resource-box-actions-rest {
  gap: 0.32rem;
  flex-wrap: wrap;
}
.application.mgne .resource-box-actions-rest > button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 0.5rem;
  white-space: nowrap;
}
.application.mgne .inventory-header {
  justify-content: space-between;
}
.application.mgne .inventory-header h3 {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: #ab8b68;
  font-size: 0.82rem;
}
.application.mgne .item-row {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.48rem 0.2rem 0.48rem 0.55rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: linear-gradient(90deg, rgba(183, 70, 31, 0.09), transparent 35%), linear-gradient(180deg, rgba(204, 178, 146, 0.02), rgba(19, 16, 15, 0.12)), rgba(17, 12, 10, 0.8);
}
.application.mgne .item-row:hover {
  border-color: rgba(196, 154, 69, 0.28);
  background: linear-gradient(90deg, rgba(183, 70, 31, 0.12), transparent 35%), linear-gradient(180deg, rgba(204, 178, 146, 0.04), rgba(19, 16, 15, 0.12)), rgba(17, 12, 10, 0.88);
}
.application.mgne .item-name {
  color: #ccb292;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
}
.application.mgne .check-grid {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.application.mgne.item-sheet .item-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.45rem 0.9rem;
  align-items: center;
}
.application.mgne.item-sheet .check-grid > label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  width: fit-content;
  margin: 0;
}
.application.mgne .checkbox-line {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  width: fit-content;
}
.application.mgne .checkbox-line.active {
  color: #dd6b2d;
  font-weight: 600;
}
.application.mgne .check-grid input[type="checkbox"],
.application.mgne .checkbox-line input[type="checkbox"] {
  --checkbox-size: 0.9rem;
  flex: 0 0 0.9rem;
  width: 0.9rem;
  height: 0.9rem;
  min-width: 0.9rem;
  padding: 0;
  margin: 0;
  position: relative;
}
@media (max-width: 820px) {
  .application.mgne.item-sheet .item-form-grid-two,
  .application.mgne.item-sheet .item-form-grid-three {
    grid-template-columns: minmax(0, 1fr);
  }
}
.application.mgne .ability-label {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.application.mgne .resource-label-accent {
  color: #dd6b2d;
  text-shadow: 0 0 12px rgba(183, 70, 31, 0.18);
}
.application.mgne .ability-score {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 58px;
  min-height: 32px;
  padding: 0.08rem;
  border-radius: 6px;
  border: 1px solid rgba(196, 154, 69, 0.14);
  background: rgba(17, 12, 10, 0.54);
}
.application.mgne .ability-input {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 1.05rem;
  line-height: 1;
  color: #ab8b68;
  padding: 0.12rem;
}
.application.mgne select.ability-input {
  flex: 1 1 auto;
  width: 100%;
}
.application.mgne .ability-score-text {
  flex-direction: column;
  gap: 0.02rem;
}
.application.mgne .ability-defense-main {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ab8b68;
  font-size: 0.8rem;
}
.application.mgne .ability-defense-sub {
  color: #7e664f;
  font-size: 0.62rem;
}
.application.mgne .character .ability-card:nth-child(odd),
.application.mgne .character .resource-box:nth-child(odd) {
  background: linear-gradient(180deg, rgba(79, 125, 115, 0.1), transparent 55%), linear-gradient(180deg, rgba(204, 178, 146, 0.04), transparent 35%), rgba(64, 47, 37, 0.66);
}
.application.mgne .creature .resource-box,
.application.mgne .companion .resource-box,
.application.mgne .creature .ability-card,
.application.mgne .companion .ability-card {
  background: linear-gradient(180deg, rgba(127, 29, 23, 0.11), transparent 60%), linear-gradient(180deg, rgba(204, 178, 146, 0.04), transparent 35%), rgba(64, 47, 37, 0.66);
}
@media (max-width: 960px) {
  .application.mgne .sheet-header,
  .application.mgne .resource-bar,
  .application.mgne .ability-grid,
  .application.mgne .grid.two,
  .application.mgne .grid.three {
    grid-template-columns: 1fr;
  }
  .application.mgne .item-row {
    grid-template-columns: 1fr;
  }
}
.application.mgne.roll-dialog .window-content {
  padding: 0.55rem;
  background: radial-gradient(circle at top left, rgba(221, 107, 45, 0.14), transparent 26%), linear-gradient(180deg, rgba(27, 21, 18, 0.26), rgba(19, 16, 15, 0.22)), url("../assets/ui/page_background.webp") center center / cover no-repeat, linear-gradient(180deg, #1b1512, #13100f 120%);
}
.application.mgne.roll-dialog .dialog-content {
  padding: 0;
}
.application.mgne.roll-dialog .mgne-roll-dialog {
  background: linear-gradient(135deg, rgba(183, 70, 31, 0.1), transparent 32%), linear-gradient(180deg, rgba(27, 21, 18, 0.94), rgba(19, 16, 15, 0.98)), #13100f;
  border: 1px solid rgba(196, 154, 69, 0.28);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 236, 203, 0.08), inset 0 0 0 1px rgba(255, 236, 203, 0.03);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem;
}
.application.mgne.roll-dialog .mgne-roll-dialog::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(196, 154, 69, 0.16);
  border-radius: calc(8px - 4px);
}
.application.mgne.roll-dialog .mgne-roll-dialog > p:first-child {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  color: #c49a45;
  margin: 0;
}
.application.mgne.roll-dialog .mgne-roll-dialog > p:nth-child(2) {
  margin: 0;
  color: #ab8b68;
  font-style: italic;
}
.application.mgne.roll-dialog .mgne-roll-dialog label {
  color: #ccb292;
}
.application.mgne.roll-dialog .mgne-roll-dialog strong {
  color: #ccb292;
}
.application.mgne.roll-dialog .mgne-roll-dialog label,
.application.mgne.roll-dialog .mgne-roll-dialog .checkbox-line {
  color: #ccb292;
}
.application.mgne.roll-dialog .form-footer button {
  min-width: 132px;
}
.mgne-chat-card {
  background: linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 24%), linear-gradient(135deg, rgba(183, 70, 31, 0.08), transparent 40%), linear-gradient(180deg, rgba(27, 21, 18, 0.52), rgba(19, 16, 15, 0.34)), url("../assets/ui/page_background.webp") center center / cover no-repeat, linear-gradient(180deg, rgba(41, 30, 24, 0.88) 0%, color-mix(in srgb, rgba(41, 30, 24, 0.88) 88%, black) 100%);
  border: 1px solid rgba(171, 139, 104, 0.34);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 236, 203, 0.08), inset 0 0 0 1px rgba(255, 236, 203, 0.03);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.68rem;
  color: #52453c;
  background: radial-gradient(circle at top right, rgba(79, 125, 115, 0.1), transparent 22%), linear-gradient(135deg, rgba(183, 70, 31, 0.1), transparent 38%), linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 24%), linear-gradient(180deg, rgba(27, 21, 18, 0.22), rgba(19, 16, 15, 0.18)), url("../assets/ui/page_background.webp") right bottom / cover no-repeat, rgba(41, 30, 24, 0.88);
}
.mgne-chat-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(196, 154, 69, 0.16);
  border-radius: calc(8px - 4px);
}
.mgne-chat-card .chat-card-header {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.mgne-chat-card .chat-card-header img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(196, 154, 69, 0.38);
  box-shadow: 0 0 0 2px rgba(204, 178, 146, 0.06);
}
.mgne-chat-card .chat-eyebrow {
  display: none;
}
.mgne-chat-card h3 {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: #6e3d2a;
  font-size: 0.82rem;
}
.mgne-chat-card .chat-actor,
.mgne-chat-card .chat-subtitle,
.mgne-chat-card .chat-formula,
.mgne-chat-card .chat-special {
  margin: 0;
}
.mgne-chat-card .chat-actor {
  color: #52453c;
}
.mgne-chat-card .chat-formula {
  color: #52453c;
  font-size: 0.72rem;
  font-style: italic;
  margin: 0;
}
.mgne-chat-card .chat-formula code {
  color: #ab8b68;
  background: rgba(19, 16, 15, 0.65);
  padding: 0.08em 0.38em;
  border-radius: 3px;
  font-style: normal;
}
.mgne-chat-card .chat-outcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.42rem 0.65rem 0.42rem 0.8rem;
  border-radius: 6px;
  background: rgba(19, 16, 15, 0.72);
  border-left: 3px solid rgba(221, 107, 45, 0.7);
}
.mgne-chat-card .chat-outcome-label {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.88rem;
  color: #e69062;
  line-height: 1.1;
}
.mgne-chat-card .chat-outcome-total {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 1.7rem;
  line-height: 1;
  color: rgba(204, 178, 146, 0.88);
  text-shadow: 0 0 18px rgba(221, 107, 45, 0.18);
  flex-shrink: 0;
}
.mgne-chat-card .chat-damage-total {
  text-align: center;
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 2.2rem;
  line-height: 1;
  color: #e38450;
  text-shadow: 0 0 20px rgba(183, 70, 31, 0.3);
  padding: 0.3rem 0;
}
.mgne-chat-card .chat-special {
  padding: 0.42rem 0.55rem;
  border-left: 3px solid rgba(221, 107, 45, 0.55);
  background: rgba(17, 12, 10, 0.85);
  color: #ccb292;
}
.mgne-chat-card .chat-omen-remind {
  padding: 0.38rem 0.55rem;
  border-left: 3px solid rgba(196, 154, 69, 0.6);
  background: rgba(30, 22, 8, 0.82);
  color: #c9a84c;
  font-size: 0.75rem;
  margin: 0;
  font-style: italic;
}
.mgne-chat-card .chat-omen-neutralize {
  border-left-color: rgba(79, 125, 115, 0.7);
  color: #9bc0b8;
}
.mgne-chat-card .chat-omen-used {
  padding: 0.28rem 0.55rem;
  color: #c9a84c;
  font-size: 0.74rem;
  margin: 0;
  font-style: italic;
}
.mgne-chat-card.outcome-critical-success,
.mgne-chat-card.outcome-success,
.mgne-chat-card.outcome-steady {
  border-color: rgba(79, 125, 115, 0.42);
}
.mgne-chat-card.outcome-critical-success .chat-outcome,
.mgne-chat-card.outcome-success .chat-outcome,
.mgne-chat-card.outcome-steady .chat-outcome {
  border-left-color: rgba(79, 125, 115, 0.8);
}
.mgne-chat-card.outcome-critical-success .chat-outcome-label,
.mgne-chat-card.outcome-success .chat-outcome-label,
.mgne-chat-card.outcome-steady .chat-outcome-label {
  color: #9bc0b8;
}
.mgne-chat-card.outcome-critical-success .chat-outcome-total,
.mgne-chat-card.outcome-success .chat-outcome-total,
.mgne-chat-card.outcome-steady .chat-outcome-total {
  color: rgba(155, 192, 184, 0.9);
  text-shadow: 0 0 18px rgba(79, 125, 115, 0.3);
}
.mgne-chat-card.outcome-failure,
.mgne-chat-card.outcome-broken,
.mgne-chat-card.outcome-fumble {
  border-color: rgba(127, 29, 23, 0.48);
}
.mgne-chat-card.outcome-failure .chat-outcome,
.mgne-chat-card.outcome-broken .chat-outcome,
.mgne-chat-card.outcome-fumble .chat-outcome {
  border-left-color: rgba(221, 107, 45, 0.8);
}
.mgne-chat-card.outcome-failure .chat-outcome-label,
.mgne-chat-card.outcome-broken .chat-outcome-label,
.mgne-chat-card.outcome-fumble .chat-outcome-label {
  color: #eaa37c;
}
.mgne-chat-card.mode-apply-damage .chat-damage-total,
.mgne-chat-card.mode-damage .chat-damage-total {
  color: #e38450;
}
.mgne-chat-card .chat-card-actions {
  margin-top: 0.2rem;
}
.mgne-roll-damage-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.38rem 0.7rem;
  border: 1px solid #dd6b2d;
  border-radius: 6px;
  background: #b7461f;
  color: #f8ede0;
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mgne-roll-damage-btn .dmg-formula {
  color: #fff5e8;
  font-size: 0.75rem;
  font-weight: 700;
}
.mgne-roll-damage-btn:hover {
  background: #da5325;
  border-color: #e69062;
  color: #fff;
}
.mgne-roll-damage-btn.is-critical {
  border: 1px solid #c49a45;
  background: #a27e34;
  color: #fff5d0;
  font-weight: 700;
}
.mgne-roll-damage-btn.is-critical .dmg-formula {
  color: #fff;
}
.mgne-roll-damage-btn.is-critical:hover {
  background: #c49a45;
  color: #fff;
}
.chat-apply-actions {
  margin-top: 0.35rem;
}
.mgne-apply-damage-select {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid #dd6b2d;
  border-radius: 6px;
  background: #1b1512;
  color: #ab8b68;
  font-family: "LoraMGNE", "Book Antiqua", serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mgne-apply-damage-select option {
  background: #1b1512;
  color: #ab8b68;
}
.mgne-apply-damage-select:hover {
  border-color: #e69062;
  background: rgba(183, 70, 31, 0.18);
}
.mgne-apply-damage-select:focus {
  outline: none;
  border-color: #dd6b2d;
}
