@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: #e89a5f;
  --mgne-accent-alt: #4f7d73;
  --mgne-text: #ccb292;
  --mgne-text-soft: #a68e78;
  --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(232, 90, 80, 0.4), rgba(216, 122, 79, 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(232, 154, 95, 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(216, 122, 79, 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(232, 154, 95, 0.7);
  box-shadow: 0 0 0 1px rgba(232, 154, 95, 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(232, 154, 95, 0.2), rgba(232, 90, 80, 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(232, 154, 95, 0.7);
  color: #d9c6ae;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 18px rgba(232, 90, 80, 0.26);
}
.application.mgne label {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ab8b68;
  font-size: 0.74rem;
}
.application.mgne.item-sheet label,
.application.mgne.item-sheet .item-form-row > label {
  color: #1b1512;
}
.application.mgne fieldset {
  background: linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 24%), linear-gradient(135deg, rgba(216, 122, 79, 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.character fieldset p {
  color: #1b1512;
}
.application.mgne fieldset .editor,
.application.mgne fieldset .editor-content,
.application.mgne fieldset .ProseMirror,
.application.mgne fieldset .document-editor {
  color: #d9c6ae;
  background: transparent;
}
.application.mgne fieldset .editor-content p,
.application.mgne fieldset .ProseMirror p,
.application.mgne fieldset .editor-content li,
.application.mgne fieldset .ProseMirror li {
  color: #d9c6ae;
}
.application.mgne fieldset .editor-content h1,
.application.mgne fieldset .ProseMirror h1,
.application.mgne fieldset .editor-content h2,
.application.mgne fieldset .ProseMirror h2,
.application.mgne fieldset .editor-content h3,
.application.mgne fieldset .ProseMirror h3 {
  color: #c49a45;
}
.application.mgne fieldset .editor-content .is-empty::before,
.application.mgne fieldset .ProseMirror .is-empty::before {
  color: rgba(196, 154, 69, 0.4);
}
.application.mgne fieldset .editor-menu button {
  color: #ab8b68;
  background: rgba(19, 16, 15, 0.55);
}
.application.mgne fieldset .editor-menu button:hover {
  color: #d9c6ae;
  background: rgba(196, 154, 69, 0.2);
}
.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: #1b1512;
  font-style: italic;
  letter-spacing: 0.03em;
}
.application.mgne .rollable {
  color: #d9c6ae;
  text-shadow: 0 0 12px rgba(196, 154, 69, 0.18);
}
.application.mgne .rollable:hover {
  color: #e0cfbc;
}
#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(232, 90, 80, 0.26), rgba(216, 122, 79, 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(232, 154, 95, 0.52);
  color: #b69a7c;
}
#combat .combat-controls .mgne-flee-control:disabled {
  opacity: 0.5;
}
#pause > img {
  content: url("../assets/ui/machine_god_skull.png");
  animation: none;
  width: 260px;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(0, 0, 0, 0.8));
}
#pause figcaption {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 2rem;
  font-weight: bold;
  color: #a67054;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 1px 1px 2px #000;
  letter-spacing: 2px;
}
.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(216, 122, 79, 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 minmax(auto, 9rem);
  align-items: center;
  margin-bottom: 0.6rem;
}
.application.mgne .condition-value-grid select {
  width: auto;
  min-width: 5rem;
  max-width: 9rem;
}
.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(160, 136, 120, 0.3);
  background: linear-gradient(180deg, rgba(171, 139, 104, 0.04), transparent 30%), linear-gradient(180deg, rgba(216, 122, 79, 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;
}
.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: #ab8b68;
}
.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(171, 139, 104, 0.28);
  color: #ab8b68;
  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: #b58b73;
  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: #a68e78;
}
.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(232, 154, 95, 0.7);
  background: linear-gradient(180deg, rgba(232, 154, 95, 0.26), rgba(232, 90, 80, 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: #a68e78;
  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 .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-sheet h3,
.application.mgne.item-sheet .inventory-header h3 {
  color: #1b1512;
}
.application.mgne.character .condition-value-grid label,
.application.mgne.character .condition-flag-grid label {
  color: #1b1512;
}
.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(216, 122, 79, 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(216, 122, 79, 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;
  padding: 0.1rem 0.3rem 0.1rem 0.2rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.application.mgne .checkbox-line.active {
  color: #f5dfa0;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(196, 154, 69, 0.55);
  background: rgba(196, 154, 69, 0.14);
  border: 1px solid rgba(196, 154, 69, 0.28);
  margin: -1px;
}
.application.mgne .checkbox-line:not(.active) {
  color: #ab8b68;
  border: 1px solid transparent;
  margin: -1px;
}
.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: #d9c6ae;
  text-shadow: 0 0 12px rgba(196, 154, 69, 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: #a68e78;
  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(232, 90, 80, 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;
  }
}
.item-weight-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 0.45em;
  border-radius: 3px;
  font-family: "LoraMGNE", "Book Antiqua", serif;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.item-weight-badge.weight-trivial {
  color: rgba(171, 139, 104, 0.45);
  border-color: rgba(171, 139, 104, 0.2);
}
.item-weight-badge.weight-light {
  color: #ab8b68;
  border-color: rgba(171, 139, 104, 0.35);
  background: rgba(171, 139, 104, 0.08);
}
.item-weight-badge.weight-normal {
  color: #c49a45;
  border-color: rgba(196, 154, 69, 0.4);
  background: rgba(196, 154, 69, 0.1);
}
.item-weight-badge.weight-heavy {
  color: #ab8b68;
  border-color: rgba(196, 154, 69, 0.45);
  background: rgba(149, 128, 104, 0.12);
}
.load-display {
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: default;
}
.load-overloaded {
  color: #d9c6ae !important;
  text-shadow: 0 0 6px rgba(196, 154, 69, 0.5);
}
.resource-box-overloaded {
  border-color: rgba(196, 154, 69, 0.6) !important;
  background: rgba(149, 128, 104, 0.1) !important;
}
.resource-box-overloaded .resource-label-accent {
  color: #d9c6ae !important;
}
.item-name[data-tooltip] {
  cursor: help;
}
.item-name[data-tooltip]:hover {
  text-decoration: underline dotted rgba(196, 154, 69, 0.55);
}
#tooltip.mgne-item-tooltip {
  max-width: 22rem;
  font-family: "LoraMGNE", "Book Antiqua", serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #ccb292;
  background: rgba(51, 38, 30, 0.66);
  border: 1px solid rgba(196, 154, 69, 0.35);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}
.item-broken-badge {
  display: inline-block;
  margin-left: 0.3em;
  padding: 0.05em 0.4em;
  font-size: 0.65em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d9c6ae;
  background: rgba(149, 128, 104, 0.14);
  border: 1px solid rgba(171, 139, 104, 0.45);
  border-radius: 3px;
  vertical-align: middle;
}
.item-burned-badge {
  color: #c49a45;
  background: rgba(196, 154, 69, 0.12);
  border-color: rgba(196, 154, 69, 0.4);
}
.item-durability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.1em 0.45em;
  font-size: 0.7em;
  font-weight: 700;
  color: rgba(171, 139, 104, 0.65);
  border: 1px solid rgba(171, 139, 104, 0.2);
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.item-durability-badge.durability-broken {
  color: #d9c6ae;
  border-color: rgba(171, 139, 104, 0.4);
  background: rgba(149, 128, 104, 0.1);
  text-decoration: line-through;
}
.item-row-broken {
  opacity: 0.6;
  filter: grayscale(0.4);
}
.item-row-broken .item-name {
  text-decoration: line-through;
  color: #d6c1a7;
}
.weapon-properties-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  padding: 0.5rem 0.6rem;
  background: rgba(171, 139, 104, 0.04);
  border: 1px solid rgba(171, 139, 104, 0.12);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.weapon-properties-grid .property-check {
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-family: "LoraMGNE", "Book Antiqua", serif;
  font-size: 0.82rem;
  color: #ccb292;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  transition: background 0.15s;
}
.weapon-properties-grid .property-check:hover {
  background: rgba(196, 154, 69, 0.08);
}
.weapon-properties-grid .property-check input[type="checkbox"] {
  accent-color: #c49a45;
}
.weapon-property-badge {
  display: inline-block;
  margin-left: 0.3em;
  padding: 0.05em 0.35em;
  font-size: 0.62em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(196, 154, 69, 0.85);
  background: rgba(196, 154, 69, 0.1);
  border: 1px solid rgba(196, 154, 69, 0.3);
  border-radius: 3px;
  vertical-align: middle;
}
.creature-trait-trigger {
  font-size: 0.82em;
  color: rgba(204, 178, 146, 0.65);
  font-style: italic;
  margin-left: 0.2em;
}
.creature-traits-container {
  border: 1px solid rgba(232, 90, 80, 0.35);
  border-left: 3px solid rgba(232, 90, 80, 0.65);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(232, 90, 80, 0.05), transparent 60%), rgba(64, 47, 37, 0.85);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.creature-traits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(232, 90, 80, 0.25);
  padding-bottom: 0.4rem;
  margin-bottom: 0.1rem;
}
.creature-traits-header h3 {
  margin: 0;
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ed7c74;
}
.creature-traits-header button {
  font-size: 0.72rem;
  padding: 0.15em 0.6em;
  background: rgba(232, 90, 80, 0.12);
  border: 1px solid rgba(232, 90, 80, 0.35);
  color: #ea6b62;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.creature-traits-header button:hover {
  background: rgba(232, 90, 80, 0.22);
  color: #ee857d;
}
.creature-traits-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.creature-trait-card {
  background: rgba(19, 16, 15, 0.3);
  border: 1px solid rgba(232, 90, 80, 0.2);
  border-radius: 3px;
  padding: 0.35rem 0.5rem;
  transition: background 0.15s, border-color 0.15s;
}
.creature-trait-card:hover {
  background: rgba(232, 90, 80, 0.08);
  border-color: rgba(232, 90, 80, 0.35);
}
.creature-trait-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.creature-trait-name {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-family: "LoraMGNE", "Book Antiqua", serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #ccb292;
  flex: 1;
  min-width: 0;
  cursor: default;
}
.creature-trait-name i {
  color: rgba(232, 90, 80, 0.7);
  font-size: 0.75em;
}
.creature-trait-trigger {
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(204, 178, 146, 0.55);
  white-space: nowrap;
}
.creature-trait-card .item-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}
.creature-trait-card .item-actions button {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(171, 139, 104, 0.18);
  color: rgba(171, 139, 104, 0.5);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.creature-trait-card .item-actions button:hover {
  background: rgba(171, 139, 104, 0.1);
  color: #ab8b68;
  border-color: rgba(171, 139, 104, 0.35);
}
.creature-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.6rem;
  background: rgba(64, 47, 37, 0.5);
  border: 1px solid rgba(216, 122, 79, 0.2);
  border-radius: 4px;
}
.creature-meta-label {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ccb292;
  white-space: nowrap;
}
.creature-type-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}
.creature-type-checkbox {
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.83rem;
  color: #ccb292 !important;
  cursor: pointer;
  user-select: none;
}
.creature-type-checkbox > span {
  color: #ccb292 !important;
}
.creature-type-checkbox input[type="checkbox"] {
  appearance: checkbox;
  -webkit-appearance: checkbox;
  accent-color: #d87a4f;
  width: 0.9rem;
  height: 0.9rem;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}
.creature-type-checkbox input[type="checkbox"]::before,
.creature-type-checkbox input[type="checkbox"]::after {
  display: none;
}
.creature-number-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.creature-number-input {
  width: 4rem;
  text-align: center;
  font-family: "LoraMGNE", "Book Antiqua", serif;
  font-size: 0.9rem;
  color: #ccb292;
  background: rgba(17, 12, 10, 0.72);
  border: 1px solid rgba(216, 122, 79, 0.3);
  border-radius: 3px;
  padding: 0.15em 0.3em;
}
.creature-number-input:focus {
  outline: none;
  border-color: rgba(216, 122, 79, 0.6);
  background: rgba(17, 12, 10, 0.9);
}
.creature-action-table-section .action-table-drop-zone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  min-height: 2.4rem;
  font-size: 0.88rem;
  color: #ccb292;
}
.creature-action-table-section .action-table-drop-zone i {
  font-size: 1em;
  color: #d87a4f;
}
.creature-action-table-section .action-table-drop-zone .action-table-name {
  font-weight: 600;
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  color: #ccb292;
}
.creature-action-table-section .action-table-drop-zone.drop-hint {
  border: 2px dashed rgba(216, 122, 79, 0.35);
  background: rgba(216, 122, 79, 0.04);
  color: rgba(204, 178, 146, 0.5);
  font-style: italic;
  justify-content: center;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.creature-action-table-section .action-table-drop-zone.drop-hint i {
  color: rgba(216, 122, 79, 0.5);
}
.creature-action-table-section .action-table-drop-zone.drop-hint:hover,
.creature-action-table-section .action-table-drop-zone.drop-hint.drag-over {
  background: rgba(216, 122, 79, 0.09);
  border-color: rgba(216, 122, 79, 0.6);
  color: rgba(204, 178, 146, 0.7);
}
.creature-action-table-section .action-table-drop-zone.drop-hint:hover i,
.creature-action-table-section .action-table-drop-zone.drop-hint.drag-over i {
  color: #d87a4f;
}
.creature-action-table-section .action-table-buttons {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.creature-action-table-section .action-table-buttons button {
  font-size: 0.75rem;
  padding: 0.15em 0.55em;
  background: rgba(149, 128, 104, 0.1);
  border: 1px solid rgba(196, 154, 69, 0.3);
  color: #d6c1a7;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.creature-action-table-section .action-table-buttons button:hover {
  background: rgba(149, 128, 104, 0.22);
  color: #ab8b68;
}
.application.mgne.party .party-credits-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(196, 154, 69, 0.35);
  border-radius: 6px;
  background: rgba(17, 12, 10, 0.7);
}
.application.mgne.party .party-credits-stepper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.application.mgne.party .credits-input {
  width: 5rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  color: #c49a45;
  background: rgba(19, 16, 15, 0.6);
  border: 1px solid rgba(196, 154, 69, 0.3);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
}
.application.mgne.party .credits-symbol {
  color: #c49a45;
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0.1rem;
}
.application.mgne.party .credits-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(171, 139, 104, 0.28);
  border-radius: 6px;
  background: rgba(17, 12, 10, 0.8);
  color: #ab8b68;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.application.mgne.party .credits-btn:hover {
  background: rgba(196, 154, 69, 0.18);
  border-color: rgba(196, 154, 69, 0.55);
  color: #c49a45;
}
.application.mgne.party .party-member-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.application.mgne.party .party-member-row {
  display: grid;
  grid-template-columns: 2rem 1fr 5rem 6rem 5.5rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
}
.application.mgne.party .party-member-row.party-member-header {
  color: #a68e78;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(171, 139, 104, 0.18);
  padding-bottom: 0.25rem;
  margin-bottom: 0.1rem;
}
.application.mgne.party .party-member-row:not(.party-member-header) {
  background: rgba(17, 12, 10, 0.75);
  border: 1px solid transparent;
}
.application.mgne.party .party-member-row:not(.party-member-header):hover {
  border-color: rgba(196, 154, 69, 0.22);
  background: rgba(17, 12, 10, 0.9);
}
.application.mgne.party .party-member-portrait {
  width: 2rem;
  height: 2rem;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(171, 139, 104, 0.25);
}
.application.mgne.party .party-member-name a {
  color: #ccb292;
  font-weight: 700;
  font-size: 0.9rem;
}
.application.mgne.party .party-member-name a:hover {
  color: #c49a45;
}
.application.mgne.party .party-member-hp {
  color: #ab8b68;
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}
.application.mgne.party .party-member-type {
  color: #bead9d;
  font-size: 0.78rem;
  font-style: italic;
}
.application.mgne.party .party-loot-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.4rem;
}
.application.mgne.party .party-loot-row {
  display: grid;
  grid-template-columns: 2rem 1fr 7rem 4rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
}
.application.mgne.party .party-loot-row.party-loot-header {
  color: #a68e78;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(171, 139, 104, 0.18);
  padding-bottom: 0.25rem;
  margin-bottom: 0.1rem;
}
.application.mgne.party .party-loot-row:not(.party-loot-header) {
  background: rgba(17, 12, 10, 0.75);
  border: 1px solid transparent;
}
.application.mgne.party .party-loot-row:not(.party-loot-header):hover {
  border-color: rgba(196, 154, 69, 0.22);
  background: rgba(17, 12, 10, 0.9);
}
.application.mgne.party .item-portrait {
  width: 2rem;
  height: 2rem;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(171, 139, 104, 0.25);
}
.application.mgne.party .item-type-label {
  color: #a68e78;
  font-size: 0.78rem;
  font-style: italic;
}
.application.mgne.party .party-drop-hint {
  color: rgba(166, 142, 120, 0.7);
  font-size: 0.75rem;
  font-style: italic;
  text-align: center;
  margin-top: 0.5rem;
  padding: 0.3rem;
  border: 1px dashed rgba(171, 139, 104, 0.18);
  border-radius: 6px;
}
.application.mgne.roll-dialog .window-content {
  padding: 0.55rem;
  background: radial-gradient(circle at top left, rgba(232, 154, 95, 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(216, 122, 79, 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(216, 122, 79, 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: #a08878;
  background: radial-gradient(circle at top right, rgba(79, 125, 115, 0.1), transparent 22%), linear-gradient(135deg, rgba(216, 122, 79, 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: #ab8b68;
  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: #a08878;
}
.mgne-chat-card .chat-formula {
  color: #a08878;
}
.mgne-chat-card .chat-formula code {
  color: #ccb292;
  background: rgba(19, 16, 15, 0.75);
  padding: 0.1em 0.42em;
  border-radius: 3px;
}
.mgne-chat-card .chat-result-line {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(196, 154, 69, 0.28);
  border-radius: 6px;
  background: rgba(19, 16, 15, 0.78);
}
.mgne-chat-card .chat-result-label {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.62rem;
  color: #ccb292;
}
.mgne-chat-card .chat-result-total {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  font-size: 1.08rem;
  color: #ccb292;
}
.mgne-chat-card .chat-outcome.has-tooltip,
.mgne-chat-card .chat-damage-total.has-tooltip {
  cursor: pointer;
  user-select: none;
}
.mgne-chat-card .chat-outcome.has-tooltip:hover,
.mgne-chat-card .chat-damage-total.has-tooltip:hover {
  filter: brightness(1.12);
}
.mgne-chat-card .chat-outcome .chat-tooltip-icon,
.mgne-chat-card .chat-damage-total .chat-tooltip-icon {
  opacity: 0.55;
  font-size: 0.75em;
  margin-left: 0.3rem;
  vertical-align: middle;
  transition: opacity 0.15s;
}
.mgne-chat-card .chat-outcome.tooltip-open .chat-tooltip-icon,
.mgne-chat-card .chat-damage-total.tooltip-open .chat-tooltip-icon {
  opacity: 1;
}
.mgne-chat-card .chat-dice-tooltip {
  margin-top: 0.4rem;
  padding: 0.4rem 0.55rem;
  background: rgba(19, 16, 15, 0.85);
  border: 1px solid rgba(171, 139, 104, 0.22);
  border-radius: 6px;
}
.mgne-chat-card .chat-dice-tooltip .dice-roll {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.mgne-chat-card .chat-dice-tooltip .dice-formula {
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  color: rgba(204, 178, 146, 0.78);
}
.mgne-chat-card .chat-dice-tooltip .dice-tooltip {
  font-size: 0.78rem;
}
.mgne-chat-card .chat-dice-tooltip .dice {
  margin: 0.15rem 0;
}
.mgne-chat-card .chat-dice-tooltip .die-icon,
.mgne-chat-card .chat-dice-tooltip .die-face {
  color: #c49a45;
  font-size: 0.8rem;
}
.mgne-chat-card .chat-dice-tooltip .part-formula {
  color: rgba(204, 178, 146, 0.82);
  font-size: 0.72rem;
}
.mgne-chat-card .chat-dice-tooltip .part-total {
  color: #ccb292;
  font-weight: 600;
}
.mgne-chat-card .chat-dice-tooltip .max {
  color: #82b0a6;
}
.mgne-chat-card .chat-dice-tooltip .min {
  color: #eeb68c;
}
.mgne-chat-card .chat-dice-tooltip .dice-total {
  font-family: "CastorTwoMGNE", serif;
  font-size: 1.05rem;
  color: #c49a45;
  text-align: right;
  border-top: 1px solid rgba(171, 139, 104, 0.2);
  padding-top: 0.2rem;
  margin-top: 0.15rem;
}
.mgne-chat-card .chat-outcome {
  font-family: "CastorTwoMGNE", "Palatino Linotype", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: rgba(19, 16, 15, 0.72);
  border-left: 3px solid rgba(232, 154, 95, 0.7);
  color: #f0bc95;
  font-size: 0.8rem;
}
.mgne-chat-card .chat-special {
  padding: 0.42rem 0.55rem;
  border-left: 3px solid rgba(232, 154, 95, 0.55);
  background: rgba(17, 12, 10, 0.85);
  color: #ccb292;
}
.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 {
  color: #9bc0b8;
  border-left-color: rgba(79, 125, 115, 0.8);
}
.mgne-chat-card.outcome-failure,
.mgne-chat-card.outcome-broken,
.mgne-chat-card.outcome-fumble {
  border-color: rgba(232, 90, 80, 0.48);
}
.mgne-chat-card.outcome-failure .chat-outcome,
.mgne-chat-card.outcome-broken .chat-outcome,
.mgne-chat-card.outcome-fumble .chat-outcome {
  color: #f4cdaf;
  border-left-color: rgba(232, 154, 95, 0.8);
}
.mgne-chat-card.mode-apply-damage .chat-result-total,
.mgne-chat-card.mode-damage .chat-result-total {
  color: #edb183;
}
.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 #e89a5f;
  border-radius: 6px;
  background: #d87a4f;
  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: #df9370;
  border-color: #f0bc95;
  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;
}
.mgne-omen-reroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.38rem 0.7rem;
  border: 1px solid #c49a45;
  border-radius: 6px;
  background: #8f6f2d;
  color: #fff5d0;
  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-omen-reroll-btn:hover {
  background: #ae8737;
  border-color: #d3b373;
  color: #fff;
}
.chat-apply-actions {
  margin-top: 0.35rem;
}
.mgne-apply-damage-select {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid #e89a5f;
  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: #f0bc95;
  background: rgba(183, 70, 31, 0.18);
}
.mgne-apply-damage-select:focus {
  outline: none;
  border-color: #e89a5f;
}
