@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:wght@400;500;600;700&family=IM+Fell+English+SC&display=swap");

.fvtt-les-oublies.sheet,
.fvtt-les-oublies.sheet .window-content {
  --lo-bg-deep: #0f1714;
  --lo-bg-moss: #1a2820;
  --lo-bg-night: #18211b;
  --lo-panel: rgba(247, 237, 218, 0.92);
  --lo-panel-heavy: rgba(236, 222, 196, 0.94);
  --lo-panel-soft: rgba(255, 250, 241, 0.76);
  --lo-ink: #221610;
  --lo-ink-soft: #584336;
  --lo-gold: #cfb06a;
  --lo-copper: #8d5c3b;
  --lo-blood: #6d2922;
  --lo-shadow: rgba(0, 0, 0, 0.42);
  --lo-line: rgba(110, 77, 53, 0.4);
  --lo-glow: rgba(207, 176, 106, 0.22);
  --lo-space-2xs: 0.25rem;
  --lo-space-xs: 0.4rem;
  --lo-space-sm: 0.55rem;
  --lo-space-md: 0.72rem;
  --lo-space-lg: 0.9rem;
  --lo-space-xl: 1rem;
  --lo-radius-sm: 10px;
  --lo-radius-md: 12px;
  --lo-radius-lg: 14px;
  --lo-radius-xl: 16px;
  --lo-font-body: 0.94rem;
  --lo-font-meta: 0.84rem;
  --lo-font-label: 0.68rem;
  --lo-font-button: 0.68rem;
  --lo-control-height: 1.95rem;
  --lo-number-width: 4.75rem;
}

body.system-fvtt-les-oublies #pause {
  font-size: 2rem;
}

body.system-fvtt-les-oublies #pause.paused {
  gap: 0.5rem;
}

body.system-fvtt-les-oublies #pause > figcaption {
  color: #d9d4ca;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.22);
}

body.system-fvtt-les-oublies #pause > img {
  opacity: 0;
  width: 0;
  height: 0;
}

body.system-fvtt-les-oublies #pause::before {
  content: "";
  display: block;
  width: 200px;
  height: 200px;
  margin-bottom: 0.75rem;
  background: url("../assets/ui/pause_oublie.webp") center/contain no-repeat;
  animation: lo-pause-logo 4.2s ease-in-out infinite;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

@keyframes lo-pause-logo {
  0%,
  100% {
    transform: scale(0.98) translateY(0);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
  }

  50% {
    transform: scale(1.03) translateY(-6px);
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.45));
  }
}

.fvtt-les-oublies.sheet {
  color: var(--lo-ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  background:
    radial-gradient(circle at top left, rgba(120, 103, 63, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(78, 107, 76, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(14, 22, 18, 0.95), rgba(23, 31, 26, 0.96));
}

.fvtt-les-oublies.sheet .window-content {
  background:
    linear-gradient(180deg, rgba(12, 19, 16, 0.92), rgba(22, 29, 25, 0.96)),
    radial-gradient(circle at 20% 10%, rgba(207, 176, 106, 0.08), transparent 26%);
  color: var(--lo-ink);
  overflow-x: hidden;
  overflow-y: auto;
}

.fvtt-les-oublies {
  color: var(--lo-ink);

  .les-oublies-sheet {
    padding: var(--lo-space-xs);
    position: relative;
  }

  .les-oublies-sheet::before {
    content: "";
    position: absolute;
    inset: -0.35rem;
    border: 1px solid rgba(207, 176, 106, 0.18);
    border-radius: 18px;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(36, 23, 14, 0.5), inset 0 0 40px rgba(0, 0, 0, 0.12);
  }

  .hero-banner {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: var(--lo-space-xl);
    align-items: stretch;
    margin-bottom: var(--lo-space-xl);
    padding: 0.85rem 0.95rem 0.9rem;
    border-radius: var(--lo-radius-xl);
    background:
      linear-gradient(135deg, rgba(250, 240, 217, 0.98), rgba(232, 214, 182, 0.92)),
      linear-gradient(180deg, rgba(207, 176, 106, 0.18), rgba(109, 41, 34, 0.08));
    border: 1px solid rgba(207, 176, 106, 0.4);
    box-shadow:
      0 18px 40px var(--lo-shadow),
      inset 0 1px 0 rgba(255, 250, 242, 0.7),
      inset 0 0 0 1px rgba(121, 80, 51, 0.08);
    position: relative;
    overflow: hidden;
  }

  .hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent),
      radial-gradient(circle at 85% 15%, rgba(78, 107, 76, 0.16), transparent 18%);
    mix-blend-mode: soft-light;
    pointer-events: none;
  }

  .profile-img {
    width: 96px;
    height: 118px;
    object-fit: cover;
    border: 2px solid rgba(85, 55, 34, 0.7);
    border-radius: var(--lo-radius-lg);
    background: linear-gradient(180deg, #291e17, #5f4435);
    box-shadow:
      0 14px 24px rgba(27, 14, 9, 0.35),
      0 0 0 3px rgba(255, 246, 226, 0.35);
    position: relative;
    z-index: 1;
  }

  .hero-copy,
  .header-fields {
    flex: 1;
    position: relative;
    z-index: 1;
    padding-right: 2.5rem;
  }

  .sheet-kicker {
    margin: 0 0 0.18rem;
    color: var(--lo-blood);
    font-family: "Cinzel", serif;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }

  .sheet-title {
    margin: 0;
    line-height: 1;
  }

  .sheet-title input,
  .header-fields h1 input {
    font-family: "IM Fell English SC", "Cinzel", serif;
    font-size: clamp(1.75rem, 2.2vw, 2.35rem);
    letter-spacing: 0.04em;
    color: #2b1b14;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    height: auto;
  }

  .sheet-subtitle {
    margin: var(--lo-space-xs) 0 0;
    color: var(--lo-ink-soft);
    font-size: var(--lo-font-body);
    font-style: italic;
  }

  .sheet-grid {
    display: grid;
    gap: var(--lo-space-lg);
    margin-bottom: var(--lo-space-lg);
  }

  .sheet-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--lo-space-xs);
    margin: 0 0 var(--lo-space-lg);
  }

  .sheet-tab-button {
    display: inline-flex;
    align-items: center;
    gap: var(--lo-space-xs);
    min-height: 1.9rem;
    padding: 0.4rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(207, 176, 106, 0.35);
    background: rgba(250, 240, 217, 0.2);
    color: #f4e8cf;
    font-family: "Cinzel", serif;
    font-size: var(--lo-font-button);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition: background 120ms ease, transform 120ms ease, border-color 120ms ease;
  }

  .sheet-tab-button:hover,
  .sheet-tab-button:focus {
    background: rgba(250, 240, 217, 0.3);
    border-color: rgba(207, 176, 106, 0.6);
    transform: translateY(-1px);
  }

  .sheet-tab-button.active {
    background: linear-gradient(135deg, rgba(250, 240, 217, 0.94), rgba(232, 214, 182, 0.88));
    color: #392319;
    border-color: rgba(207, 176, 106, 0.78);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  }

  .sheet-tab {
    display: none;
  }

  .sheet-tab.active {
    display: block;
  }

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

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

  .sheet-card {
    background:
      linear-gradient(180deg, var(--lo-panel), var(--lo-panel-heavy)),
      linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent);
    border: 1px solid rgba(133, 99, 74, 0.5);
    border-radius: var(--lo-radius-xl);
    padding: 0.82rem 0.82rem 0.78rem;
    margin-bottom: var(--lo-space-lg);
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 251, 243, 0.6),
      inset 0 0 0 1px rgba(255, 243, 218, 0.18);
    position: relative;
    overflow: hidden;
  }

  .sheet-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 22%),
      radial-gradient(circle at 100% 0, rgba(207, 176, 106, 0.1), transparent 26%);
    pointer-events: none;
  }

  .sheet-card h2,
  .sheet-card h3 {
    font-family: "Cinzel", serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3a251a;
  }

  .sheet-card h2 {
    margin: 0 0 var(--lo-space-md);
    padding-bottom: var(--lo-space-xs);
    border-bottom: 1px solid rgba(109, 41, 34, 0.18);
    font-size: 0.92rem;
  }

  .sheet-card h3 {
    margin: 0 0 var(--lo-space-sm);
    font-size: 0.78rem;
  }

  .summary-card {
    background:
      linear-gradient(180deg, rgba(246, 235, 210, 0.94), rgba(228, 213, 179, 0.95)),
      linear-gradient(135deg, rgba(207, 176, 106, 0.16), transparent 60%);
  }

  .profiles-card {
    background:
      linear-gradient(180deg, rgba(245, 238, 223, 0.95), rgba(232, 223, 201, 0.92));
  }

  .ledger-card {
    background:
      linear-gradient(180deg, rgba(251, 244, 232, 0.95), rgba(236, 224, 198, 0.92));
  }

  .notes-card {
    background:
      linear-gradient(180deg, rgba(240, 229, 207, 0.98), rgba(223, 207, 177, 0.95));
  }

  .identity-card--compact {
    padding: 0.62rem 0.72rem 0.68rem;
  }

  .identity-card--compact h2 {
    margin-bottom: 0.5rem;
    padding-bottom: 0.2rem;
    font-size: 0.82rem;
  }

  .identity-card--compact .identity-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.35rem 0.65rem;
  }

  .identity-card--compact .field-row {
    gap: 0.4rem;
    margin-bottom: 0;
    min-width: 0;
  }

  .identity-card--compact .field-row label {
    min-width: 4.25rem;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
  }

  .identity-card--compact .field-row input[type="number"] {
    flex: 0 0 3.5rem;
    width: 3.5rem;
    min-width: 3.5rem;
  }

  .identity-card--compact .field-row input[type="text"] {
    min-width: 0;
  }

  .identity-card--compact .field-row input[type="checkbox"] {
    margin: 0;
  }

  .sheet-actions,
  .embed-buttons,
  .item-controls,
  .section-title-row {
    display: flex;
    gap: var(--lo-space-xs);
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .field-row,
  .profile-cell {
    display: flex;
    align-items: center;
    gap: var(--lo-space-sm);
    margin-bottom: var(--lo-space-sm);
  }

  .field-row label,
  .profile-cell label {
    min-width: 10rem;
    font-family: "Cinzel", serif;
    font-size: var(--lo-font-label);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #51392b;
  }

  .field-row span {
    font-family: "Cinzel", serif;
    font-size: var(--lo-font-meta);
    color: var(--lo-blood);
  }

  .profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--lo-space-sm) var(--lo-space-lg);
  }

  .profile-cell {
    padding: 0.55rem 0.65rem;
    border-radius: var(--lo-radius-lg);
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.7), rgba(230, 214, 185, 0.6));
    border: 1px solid rgba(130, 98, 71, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .group-block + .group-block {
    margin-top: var(--lo-space-lg);
  }

  .reserve-card .reserve-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--lo-space-sm);
    margin-bottom: var(--lo-space-sm);
  }

  .reserve-panel {
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border-radius: var(--lo-radius-lg);
    background: linear-gradient(180deg, rgba(255, 250, 243, 0.7), rgba(230, 214, 185, 0.6));
    border: 1px solid rgba(130, 98, 71, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .reserve-panel h3 {
    margin-bottom: 0.45rem;
  }

  .transfer-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.45rem;
  }

  .transfer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.4rem;
    align-items: center;
  }

  .transfer-row strong {
    min-width: 0;
    font-size: var(--lo-font-body);
  }

  .transfer-row input[type="number"] {
    width: 3.6rem;
    min-width: 3.6rem;
  }

  .transfer-row .item-controls {
    justify-content: flex-end;
  }

  .group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--lo-space-sm);
    margin-bottom: var(--lo-space-sm);
    flex-wrap: wrap;
  }

  .profile-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--lo-space-xs);
    margin: 0;
    padding: 0.3rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(118, 85, 58, 0.24);
    background: rgba(255, 250, 243, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  }

  .profile-badge span {
    font-family: "Cinzel", serif;
    font-size: var(--lo-font-label);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #5f4332;
  }

  .profile-badge input[type="number"] {
    width: 3.2rem;
    min-width: 3.2rem;
  }

  .item-list {
    display: flex;
    flex-direction: column;
    gap: var(--lo-space-sm);
  }

  .item-card {
    display: flex;
    justify-content: space-between;
    gap: var(--lo-space-lg);
    padding: 0.62rem 0.72rem;
    border: 1px solid rgba(118, 85, 58, 0.22);
    border-radius: var(--lo-radius-lg);
    background:
      linear-gradient(180deg, rgba(255, 252, 246, 0.78), rgba(239, 229, 206, 0.78)),
      linear-gradient(135deg, rgba(207, 176, 106, 0.08), transparent);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.56),
      0 6px 14px rgba(0, 0, 0, 0.08);
    position: relative;
  }

  .item-card::before {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 0.48rem;
    bottom: 0.48rem;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--lo-gold), var(--lo-blood));
    opacity: 0.8;
  }

  .item-card > div:first-child {
    padding-left: 0.5rem;
  }

  .item-card strong,
  .reference-list strong {
    font-family: "Cinzel", serif;
    letter-spacing: 0.04em;
    color: #3d281d;
  }

  .skills-ledger-card {
    padding: 0.72rem 0.76rem 0.68rem;
  }

  .skills-ledger-card .section-title-row {
    margin-bottom: 0.45rem;
  }

  .skills-group + .skills-group {
    margin-top: 0.7rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(111, 84, 55, 0.14);
  }

  .skills-columns {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.8rem;
    align-items: start;
  }

  .skills-column {
    min-width: 0;
  }

  .skills-ledger-card .group-header {
    margin-bottom: 0.4rem;
    gap: 0.45rem;
  }

  .skills-ledger-card .group-header h3 {
    margin: 0;
    font-size: 0.72rem;
  }

  .skills-ledger-card .profile-badge {
    padding: 0.2rem 0.38rem;
    gap: 0.32rem;
  }

  .skills-ledger-card .profile-badge span {
    font-size: 0.58rem;
  }

  .skills-ledger-card .profile-badge input[type="number"] {
    width: 2.8rem;
    min-width: 2.8rem;
  }

  .skills-item-list {
    gap: 0.35rem;
  }

  .skill-card {
    gap: 0.45rem;
    padding: 0.42rem 0.58rem;
  }

  .skill-card::before {
    left: 0.34rem;
    top: 0.34rem;
    bottom: 0.34rem;
  }

  .skill-card > div:first-child {
    padding-left: 0.38rem;
  }

  .skill-card-main {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex-wrap: wrap;
  }

  .skill-card strong {
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .skill-summary {
    color: #5c4334;
    font-size: 0.66rem;
    line-height: 1.1;
  }

  .skill-controls {
    gap: 0.28rem;
    flex-wrap: nowrap;
  }

  .skills-ledger-card .item-controls button {
    min-height: 1.6rem;
    padding: 0.22rem 0.48rem;
    font-size: 0.58rem;
  }

  @media (max-width: 980px) {
    .skills-columns {
      grid-template-columns: minmax(0, 1fr) !important;
    }
  }

  .reference-list {
    margin: 0;
    padding-left: 1rem;
  }

  .reference-list li + li {
    margin-top: var(--lo-space-xs);
  }

  .creation-slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--lo-space-sm);
    margin-bottom: var(--lo-space-md);
  }

  .creation-slots--header {
    margin: var(--lo-space-sm) 0 0;
    gap: var(--lo-space-xs);
  }

  .creation-slot {
    display: flex;
    flex-direction: column;
    gap: var(--lo-space-sm);
    min-height: 8.75rem;
    padding: 0.72rem;
    border-radius: var(--lo-radius-lg);
    border: 1px dashed rgba(109, 41, 34, 0.32);
    background:
      linear-gradient(180deg, rgba(255, 252, 246, 0.84), rgba(237, 226, 203, 0.8)),
      linear-gradient(135deg, rgba(207, 176, 106, 0.08), transparent);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.56),
      0 4px 12px rgba(0, 0, 0, 0.06);
  }

  .creation-slot.is-filled {
    border-style: solid;
    border-color: rgba(118, 85, 58, 0.24);
  }

  .creation-slot.is-empty {
    justify-content: center;
    background:
      linear-gradient(180deg, rgba(248, 241, 228, 0.7), rgba(231, 219, 194, 0.74)),
      repeating-linear-gradient(
        -45deg,
        rgba(109, 41, 34, 0.035),
        rgba(109, 41, 34, 0.035) 8px,
        transparent 8px,
        transparent 16px
      );
  }

  .creation-slot-header,
  .creation-slot-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--lo-space-sm);
  }

  .creation-slot-body {
    flex: 1;
  }

  .creation-slot-kicker {
    margin: 0 0 0.15rem;
    font-family: "Cinzel", serif;
    font-size: var(--lo-font-label);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6a4d38;
  }

  .creation-slot-name {
    display: block;
    font-family: "Cinzel", serif;
    font-size: 0.95rem;
    color: #352116;
  }

  .creation-slot-image {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: var(--lo-radius-md);
    border: 1px solid rgba(118, 85, 58, 0.24);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
  }

  .creation-slot .item-controls {
    justify-content: flex-end;
  }

  .creation-slot .item-controls button {
    min-height: 1.55rem;
    padding: 0.2rem 0.5rem;
  }

  .creation-slot .help-text {
    margin: 0;
    flex: 1;
  }

  .creation-slot--compact {
    min-height: auto;
    padding: 0.42rem 0.5rem;
    gap: var(--lo-space-xs);
  }

  .creation-slot--compact .creation-slot-header {
    align-items: center;
  }

  .creation-slot--compact .creation-slot-kicker {
    margin-bottom: 0.05rem;
    font-size: 0.6rem;
  }

  .creation-slot--compact .creation-slot-name {
    font-size: 0.78rem;
    line-height: 1.1;
  }

  .item-controls--compact {
    gap: 0.2rem;
  }

  .item-controls--compact button {
    min-height: 1.3rem;
    padding: 0.08rem 0.38rem;
    font-size: 0.56rem;
  }

  .help-text {
    color: var(--lo-ink-soft);
    font-size: var(--lo-font-meta);
    font-style: italic;
  }

  .mode-button,
  .window-content button {
    cursor: pointer;
    border: 1px solid rgba(99, 61, 40, 0.45);
    border-radius: 999px;
    background:
      linear-gradient(180deg, #2e3f34, #18231d);
    color: #f2e5c8;
    font-family: "Cinzel", serif;
    font-size: var(--lo-font-button);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    min-height: 1.9rem;
    padding: 0.38rem 0.72rem;
    box-shadow:
      0 8px 18px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  }

  .mode-button--icon {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.85rem;
    min-height: 1.85rem;
    padding: 0;
    z-index: 2;
  }

  .mode-button--icon i {
    pointer-events: none;
  }

  .les-oublies-roll-dialog {
    color: var(--lo-ink);

    .sheet-card {
      margin-bottom: 0;
    }

    .field-row input,
    .field-row select {
      flex: 1;
    }

    .field-row input[type="number"] {
      flex: 0 0 var(--lo-number-width);
    }
  }

  button:hover,
  button:focus {
    transform: translateY(-1px);
    border-color: rgba(207, 176, 106, 0.75);
    box-shadow:
      0 12px 22px rgba(0, 0, 0, 0.22),
      0 0 0 1px rgba(207, 176, 106, 0.24);
  }

  input[type="text"],
  input[type="number"],
  select,
  textarea {
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(238, 226, 201, 0.96));
    border: 1px solid rgba(113, 79, 56, 0.42);
    border-radius: var(--lo-radius-sm);
    color: #2e1f18;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: var(--lo-font-body);
    min-height: var(--lo-control-height);
    padding: 0.1rem 0.55rem;
    box-shadow: inset 0 1px 3px rgba(72, 46, 30, 0.08);
  }

  input[type="number"] {
    width: var(--lo-number-width);
    min-width: var(--lo-number-width);
    text-align: center;
  }

  input[type="checkbox"] {
    accent-color: #6d2922;
  }

  .sheet-card .editor,
  .sheet-card .editor-content,
  .sheet-card .editor-container,
  prose-mirror {
    background: rgba(255, 252, 246, 0.62);
    border-radius: var(--lo-radius-md);
  }

  prose-mirror {
    border: 1px solid rgba(111, 84, 55, 0.18);
    padding: 0.45rem 0.55rem;
  }

  a,
  button[data-action="rollProfile"],
  button[data-action="rollSkill"] {
    text-decoration: none;
  }

  button[data-action="rollProfile"],
  button[data-action="rollSkill"] {
    background: linear-gradient(180deg, #6a2f29, #421914);
    color: #f8ead3;
  }

  .compagnie-sheet .hero-banner {
    background:
      linear-gradient(135deg, rgba(245, 235, 210, 0.98), rgba(224, 205, 173, 0.93)),
      linear-gradient(180deg, rgba(207, 176, 106, 0.18), rgba(58, 37, 26, 0.08));
  }

  .creature-sheet .hero-banner {
    background:
      linear-gradient(135deg, rgba(236, 226, 206, 0.96), rgba(213, 196, 166, 0.92)),
      radial-gradient(circle at 90% 15%, rgba(109, 41, 34, 0.14), transparent 28%);
  }

  @media (max-width: 900px) {
    .sheet-grid-2,
    .sheet-grid-3,
    .profile-grid,
    .creation-slots,
    .reserve-card .reserve-grid {
      grid-template-columns: 1fr;
    }

    .hero-banner {
      grid-template-columns: 1fr;
    }

    .profile-img {
      width: 100%;
      max-width: 110px;
    }
  }
}

.application.dialog:has(.les-oublies-roll-dialog) {
  --lo-bg-deep: #0f1714;
  --lo-bg-moss: #1a2820;
  --lo-bg-night: #18211b;
  --lo-panel: rgba(247, 237, 218, 0.92);
  --lo-panel-heavy: rgba(236, 222, 196, 0.94);
  --lo-panel-soft: rgba(255, 250, 241, 0.76);
  --lo-ink: #221610;
  --lo-ink-soft: #584336;
  --lo-gold: #cfb06a;
  --lo-blood: #6d2922;
  --lo-line: rgba(110, 77, 53, 0.4);
  --lo-shadow: rgba(0, 0, 0, 0.42);
  color: var(--lo-ink);
  background:
    radial-gradient(circle at top left, rgba(120, 103, 63, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(78, 107, 76, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(14, 22, 18, 0.95), rgba(23, 31, 26, 0.96));
}

.application.dialog:has(.les-oublies-roll-dialog) .window-header {
  background:
    linear-gradient(180deg, rgba(12, 19, 16, 0.96), rgba(19, 27, 22, 0.98)),
    radial-gradient(circle at 20% 0, rgba(207, 176, 106, 0.12), transparent 30%);
  color: #f4e8cf;
  border-bottom: 1px solid rgba(207, 176, 106, 0.24);
}

.application.dialog:has(.les-oublies-roll-dialog) .window-title {
  font-family: "Cinzel", serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.application.dialog:has(.les-oublies-roll-dialog) .window-content {
  padding: 0;
  background:
    linear-gradient(180deg, rgba(12, 19, 16, 0.94), rgba(22, 29, 25, 0.98)),
    radial-gradient(circle at 18% 10%, rgba(207, 176, 106, 0.08), transparent 28%);
  color: var(--lo-ink);
}

.application.dialog:has(.les-oublies-roll-dialog--attack) .window-content {
  max-height: min(78vh, 52rem) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.application.dialog:has(.les-oublies-roll-dialog) .window-footer,
.application.dialog:has(.les-oublies-roll-dialog) .form-footer {
  padding: 0.75rem 0.9rem 0.9rem;
  background:
    linear-gradient(180deg, rgba(18, 24, 20, 0.96), rgba(12, 17, 14, 0.98));
  border-top: 1px solid rgba(207, 176, 106, 0.18);
}

.application.dialog:has(.les-oublies-roll-dialog) .window-footer button,
.application.dialog:has(.les-oublies-roll-dialog) .form-footer button {
  cursor: pointer;
  border: 1px solid rgba(99, 61, 40, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, #2e3f34, #18231d);
  color: #f2e5c8;
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 1.95rem;
  padding: 0.38rem 0.8rem;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.application.dialog:has(.les-oublies-roll-dialog) .window-footer button:hover,
.application.dialog:has(.les-oublies-roll-dialog) .window-footer button:focus,
.application.dialog:has(.les-oublies-roll-dialog) .form-footer button:hover,
.application.dialog:has(.les-oublies-roll-dialog) .form-footer button:focus {
  transform: translateY(-1px);
  border-color: rgba(207, 176, 106, 0.75);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(207, 176, 106, 0.24);
}

.les-oublies-roll-dialog {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  color: var(--lo-ink, #221610);
  background:
    linear-gradient(180deg, rgba(12, 19, 16, 0.3), rgba(22, 29, 25, 0.18));
}

.les-oublies-roll-dialog .sheet-grid {
  margin-bottom: 0;
}

.les-oublies-roll-dialog--attack {
  gap: 0.65rem;
  padding: 0.72rem;
}

.les-oublies-roll-dialog--attack .attack-dialog-grid {
  align-items: start;
}

.les-oublies-roll-dialog .item-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.les-oublies-roll-dialog .item-card {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(118, 85, 58, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.78), rgba(239, 229, 206, 0.78)),
    linear-gradient(135deg, rgba(207, 176, 106, 0.08), transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 6px 14px rgba(0, 0, 0, 0.08);
  position: relative;
}

.les-oublies-roll-dialog .item-card::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.48rem;
  bottom: 0.48rem;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--lo-gold), var(--lo-blood));
  opacity: 0.8;
}

.les-oublies-roll-dialog .item-card > div:first-child {
  padding-left: 0.5rem;
}

.les-oublies-roll-dialog .item-card strong {
  font-family: "Cinzel", serif;
  letter-spacing: 0.04em;
  color: #3d281d;
}

.les-oublies-roll-dialog .sheet-card {
  margin-bottom: 0;
  background:
    linear-gradient(180deg, rgba(247, 237, 218, 0.95), rgba(236, 222, 196, 0.96)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent);
  border: 1px solid rgba(133, 99, 74, 0.5);
  border-radius: 16px;
  padding: 0.85rem 0.9rem 0.8rem;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 251, 243, 0.6),
    inset 0 0 0 1px rgba(255, 243, 218, 0.18);
  position: relative;
  overflow: hidden;
}

.les-oublies-roll-dialog .sheet-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 22%),
    radial-gradient(circle at 100% 0, rgba(207, 176, 106, 0.1), transparent 26%);
  pointer-events: none;
}

.les-oublies-roll-dialog .sheet-card > * {
  position: relative;
  z-index: 1;
}

.les-oublies-roll-dialog .sheet-card h2 {
  margin: 0 0 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(109, 41, 34, 0.18);
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3a251a;
}

.les-oublies-roll-dialog .field-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.les-oublies-roll-dialog--attack .dialog-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
}

.les-oublies-roll-dialog--attack .field-row {
  gap: 0.4rem;
  margin-bottom: 0;
  min-width: 0;
}

.les-oublies-roll-dialog--attack .field-row--wide {
  grid-column: 1 / -1;
}

.les-oublies-roll-dialog--attack .field-row--toggle input[type="checkbox"] {
  margin-left: auto;
}

.les-oublies-roll-dialog .field-row label {
  min-width: 8.5rem;
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #51392b;
}

.les-oublies-roll-dialog--attack .field-row label {
  min-width: 6.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
}

.les-oublies-roll-dialog .field-row input,
.les-oublies-roll-dialog .field-row select {
  flex: 1;
}

.les-oublies-roll-dialog--attack .field-row input[type="text"],
.les-oublies-roll-dialog--attack .field-row select {
  min-width: 0;
}

.les-oublies-roll-dialog .field-row input[type="number"] {
  flex: 0 0 4.75rem;
}

.les-oublies-roll-dialog--attack .field-row input[type="number"] {
  flex: 0 0 4.1rem;
  width: 4.1rem;
  min-width: 4.1rem;
}

@media (max-width: 900px) {
  .les-oublies-roll-dialog--attack .sheet-grid,
  .les-oublies-roll-dialog--attack .dialog-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.les-oublies-roll-dialog input[type="text"],
.les-oublies-roll-dialog input[type="number"],
.les-oublies-roll-dialog select,
.les-oublies-roll-dialog textarea {
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(238, 226, 201, 0.96));
  border: 1px solid rgba(113, 79, 56, 0.42);
  border-radius: 10px;
  color: #2e1f18;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.94rem;
  min-height: 1.95rem;
  padding: 0.1rem 0.55rem;
  box-shadow: inset 0 1px 3px rgba(72, 46, 30, 0.08);
}

.les-oublies-roll-dialog input[type="checkbox"] {
  accent-color: #6d2922;
}

.les-oublies-roll-dialog .help-text {
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 249, 239, 0.56);
  border: 1px solid rgba(118, 85, 58, 0.14);
  color: #5b4638;
  font-size: 0.84rem;
  font-style: italic;
}

.les-oublies-roll-dialog .target-status {
  font-style: normal;
  line-height: 1.35;
}

.les-oublies-roll-dialog .target-status[data-state="empty"] {
  background: rgba(120, 54, 29, 0.11);
  border-color: rgba(120, 54, 29, 0.28);
  color: #6f2b22;
}

.les-oublies-roll-dialog .target-status[data-state="selected"] {
  background: rgba(38, 89, 68, 0.12);
  border-color: rgba(38, 89, 68, 0.28);
  color: #24483a;
}

.chat-message,
.chat-popout,
#chat-log {
  .les-oublies-chat-card {
    --lo-chat-bg-top: rgba(249, 241, 227, 0.98);
    --lo-chat-bg-bottom: rgba(226, 209, 178, 0.96);
    --lo-chat-line: rgba(114, 80, 55, 0.26);
    --lo-chat-ink: #2f1f17;
    --lo-chat-soft: #6a5142;
    --lo-chat-gold: #cfb06a;
    --lo-chat-blood: #6d2922;
    color: var(--lo-chat-ink);
    background:
      linear-gradient(180deg, var(--lo-chat-bg-top), var(--lo-chat-bg-bottom)),
      linear-gradient(135deg, rgba(207, 176, 106, 0.18), transparent 72%);
    border: 1px solid rgba(133, 99, 74, 0.45);
    border-radius: var(--lo-radius-lg);
    padding: 0.54rem 0.64rem;
    margin: 0.12rem 0;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.56),
      0 10px 28px rgba(0, 0, 0, 0.14);
    position: relative;
    overflow: hidden;
  }

  .les-oublies-chat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 24%),
      radial-gradient(circle at 100% 0, rgba(207, 176, 106, 0.14), transparent 28%);
  }

  .les-oublies-chat-card.is-success {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.56),
      0 10px 28px rgba(0, 0, 0, 0.14),
      0 0 0 1px rgba(65, 107, 72, 0.18);
  }

  .les-oublies-chat-card.is-failure {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.56),
      0 10px 28px rgba(0, 0, 0, 0.14),
      0 0 0 1px rgba(109, 41, 34, 0.18);
  }

  .chat-card-banner {
    display: grid;
    grid-template-columns: 2.2rem 1fr auto;
    gap: 0.45rem;
    align-items: center;
    position: relative;
    z-index: 1;
  }

  .chat-card-portrait {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: cover;
    border-radius: var(--lo-radius-lg);
    border: 1px solid rgba(91, 60, 39, 0.5);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
    background: linear-gradient(180deg, #2c1d16, #6b4a37);
  }

  .chat-card-kicker {
    margin: 0;
    font-family: "Cinzel", serif;
    font-size: 0.54rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--lo-chat-blood);
  }

  .chat-card-header h3 {
    margin: 0.02rem 0 0;
    font-family: "Cinzel", serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #3a251a;
  }

  .chat-card-subtitle {
    margin: 0.08rem 0 0;
    color: var(--lo-chat-soft);
    font-size: 0.74rem;
    line-height: 1.2;
  }

  .chat-card-banner--confrontation {
    grid-template-columns: 2.2rem minmax(0, 1fr);
    grid-template-areas:
      "portrait heading"
      "portrait outcome";
    align-items: start;
    gap: 0.38rem 0.55rem;
  }

  .chat-card-banner--confrontation .chat-card-portrait {
    grid-area: portrait;
  }

  .chat-card-banner--confrontation .chat-card-heading {
    grid-area: heading;
    min-width: 0;
  }

  .chat-card-banner--confrontation .chat-card-outcome {
    grid-area: outcome;
    min-width: 0;
  }

  .chat-card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-bottom: 0.18rem;
  }

  .chat-card-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    background: rgba(109, 41, 34, 0.08);
    border: 1px solid rgba(109, 41, 34, 0.16);
    color: var(--lo-chat-blood);
    font-family: "Cinzel", serif;
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.1;
  }

  .chat-card-pill--soft {
    background: rgba(255, 250, 241, 0.78);
    color: var(--lo-chat-soft);
    border-color: rgba(124, 96, 74, 0.18);
  }

  .chat-card-header--confrontation h3 {
    margin-top: 0;
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .chat-card-header--confrontation .chat-card-badge {
    display: inline-flex;
    justify-content: center;
    max-width: none;
  }

  .chat-card-badge {
    align-self: start;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    border: 1px solid var(--lo-chat-line);
    background: rgba(255, 249, 239, 0.7);
    color: #3a251a;
    font-family: "Cinzel", serif;
    font-size: 0.56rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    max-width: 10rem;
    line-height: 1.15;
  }

  .chat-card-badge.success {
    background: rgba(226, 243, 225, 0.74);
    color: #29422d;
  }

  .chat-card-badge.failure {
    background: rgba(245, 223, 220, 0.74);
    color: #6d2922;
  }

  .chat-card-badge.neutral {
    background: rgba(242, 233, 212, 0.78);
  }

  .chat-card-body {
    position: relative;
    z-index: 1;
  }

  .chat-card-body p {
    margin: 0.32rem 0 0;
  }

  .roll-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.28rem 0.38rem;
    margin: 0.42rem 0 0.38rem;
  }

  .roll-summary-grid div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.22rem 0.42rem;
    border-radius: var(--lo-radius-md);
    background: rgba(255, 252, 245, 0.9);
    border: 1px solid rgba(114, 80, 55, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  }

  .roll-summary-grid span {
    display: inline;
    font-family: "Cinzel", serif;
    font-size: 0.52rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--lo-chat-blood);
    line-height: 1.1;
  }

  .roll-summary-grid strong {
    flex: 0 0 auto;
    font-size: 0.82rem;
    color: var(--lo-chat-ink);
    line-height: 1;
    text-align: right;
  }

  .roll-formula {
    margin-top: var(--lo-space-2xs);
    padding: 0.28rem 0.42rem;
    border-radius: var(--lo-radius-md);
    background: rgba(255, 249, 239, 0.82);
    border: 1px solid rgba(118, 85, 58, 0.2);
    line-height: 1.24;
    font-size: 0.78rem;
  }

  .dice-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.4rem;
  }

  .die-chip {
    min-width: 5.7rem;
    padding: 0.28rem 0.42rem;
    border-radius: var(--lo-radius-md);
    background: rgba(247, 238, 221, 0.92);
    border: 1px solid rgba(118, 85, 58, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  }

  .die-chip.selected {
    border-color: rgba(207, 176, 106, 0.86);
    background: rgba(255, 247, 228, 0.92);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.52),
      0 0 0 1px rgba(207, 176, 106, 0.28);
  }

  .die-chip strong,
  .die-chip em,
  .die-chip span {
    display: inline;
  }

  .die-chip strong {
    margin-right: 0.25rem;
    font-size: 0.72rem;
  }

  .die-chip span {
    color: var(--lo-chat-ink);
    font-size: 0.78rem;
  }

  .die-chip em {
    color: var(--lo-chat-blood);
    display: block;
    margin-top: 0.08rem;
    font-size: 0.66rem;
    line-height: 1.1;
  }

  .chat-callouts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.4rem;
  }

  .chat-callout {
    min-width: 7rem;
    flex: 1 1 7rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.2rem 0.36rem;
    padding: 0.28rem 0.42rem;
    border-radius: var(--lo-radius-md);
    background: rgba(255, 250, 241, 0.84);
    border: 1px solid rgba(114, 80, 55, 0.2);
  }

  .chat-callout span,
  .chat-callout strong,
  .chat-callout em {
    display: inline;
  }

  .chat-callout span {
    font-family: "Cinzel", serif;
    font-size: 0.52rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--lo-chat-blood);
  }

  .chat-callout strong {
    color: var(--lo-chat-ink);
    font-size: 0.78rem;
    line-height: 1.1;
  }

  .chat-callout em {
    color: var(--lo-chat-soft);
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .chat-callout.warning {
    background: rgba(245, 223, 220, 0.72);
  }

  .confrontation-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.42rem;
    margin-top: 0.42rem;
  }

  .chat-side-card {
    padding: 0.42rem 0.5rem;
    border-radius: var(--lo-radius-lg);
    border: 1px solid rgba(114, 80, 55, 0.24);
    background: rgba(255, 251, 245, 0.86);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.58),
      0 6px 16px rgba(0, 0, 0, 0.08);
  }

  .chat-side-card.is-success {
    box-shadow: inset 3px 0 0 rgba(65, 107, 72, 0.6);
  }

  .chat-side-card.is-failure {
    box-shadow: inset 3px 0 0 rgba(109, 41, 34, 0.6);
  }

  .chat-side-head {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    align-items: baseline;
    margin-bottom: 0.08rem;
  }

  .chat-side-head h2 {
    margin: 0;
    font-family: "Cinzel", serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3a251a;
  }

  .chat-side-mode {
    color: var(--lo-chat-soft);
    font-size: 0.72rem;
    font-style: italic;
  }

  @media (max-width: 720px) {
    .chat-card-banner {
      grid-template-columns: 3rem 1fr;
    }

    .chat-card-badge {
      grid-column: 1 / -1;
      justify-self: start;
    }

    .roll-summary-grid {
      grid-template-columns: 1fr 1fr;
    }
  }
}
