@layer components {
  .right-rail .log-panel {
    height: min(540px, calc(100dvh - 30px));
    min-height: 0;
    max-height: calc(100dvh - 30px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #aabfa8;
    box-shadow: 0 7px 18px #334d3b21;
  }
  .right-rail .event-log {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .right-rail .log-panel.collapsed {
    height: auto;
    min-height: 0;
  }
  .right-rail .event-log li.log-fresh {
    position: relative;
    isolation: isolate;
  }
  .right-rail .event-log li.log-fresh::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-left: 3px solid #c28c42;
    background: #fff2c9;
    opacity: 0;
    will-change: opacity, transform;
    animation: journal-flash .9s ease-out both;
  }
  @keyframes journal-flash {
    from {
      opacity: 0;
      transform: translateX(5px);
    }
    35% {
      opacity: .9;
      transform: translateX(0);
    }
    to {
      opacity: 0;
      transform: translateX(0);
    }
  }
  .script-notice {
    background: #fff1cf;
    color: #885c37;
    padding: 10px;
    border: 1px solid #b99968;
  }
  .meter {
    height: 9px;
    overflow: hidden;
    border-radius: 20px;
    background: #e8e8dc;
    border-color: #ccd5c8;
  }
  .meter > span {
    height: 100%;
    display: block;
    width: 0;
    border-radius: inherit;
    transition: width .3s ease;
  }
  .meter:not(.qi-meter, .exp-meter) > span {
    background:
      linear-gradient(
        90deg,
        #bb6b63,
        #e6aa83);
  }
  .meter.qi-meter > span {
    background:
      linear-gradient(
        90deg,
        #388d94,
        #86d5c8);
  }
  .meter.exp-meter > span {
    background:
      linear-gradient(
        90deg,
        #af8532,
        #e9c77c);
  }
  .meter.is-danger {
    border-color: #c26f62;
    box-shadow: 0 0 0 2px #eeb09e75;
  }
  .meter.is-danger > span {
    background:
      linear-gradient(
        90deg,
        #ae3844,
        #e56d65);
    animation: hp-warning 1.2s ease-in-out infinite;
  }
  @keyframes hp-warning {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: .65;
    }
  }
  .cost-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    align-self: center;
    margin: 4px auto 8px;
    padding: 4px 8px;
    border-radius: 50px;
    border: 1px solid #a6cbbd;
    background: #e8f3eb;
    color: #307660;
    font: 800 0.75rem var(--sans);
    white-space: nowrap;
    letter-spacing: -.01em;
  }
  .cost-chip.gold-cost {
    border-color: #d9c098;
    background: #fff3d9;
    color: #906b36;
  }
  .cost-chip.supply-cost {
    border-color: #bdc9a3;
    background: #eff4db;
    color: #627441;
  }
  .cost-chip.rail-cost {
    display: flex;
    margin: 5px 0 7px;
  }
  .cost-chip.is-unaffordable {
    border-color: #d8aaa1;
    color: #a35e53;
    background: #f9e8e1;
  }
  .dungeon-entry .cost-chip {
    margin: 7px 0 0;
    align-self: flex-start;
  }
  .action-tile button.is-progressing,
  .dungeon-entry button.is-progressing,
  .small-button.is-progressing,
  .action-tile button.is-progressing:disabled,
  .dungeon-entry button.is-progressing:disabled,
  .small-button.is-progressing:disabled {
    position: relative;
    overflow: hidden;
    opacity: 1;
    cursor: wait;
    background: linear-gradient(#f5f2d9, #b9d9bd);
    color: #2d634c;
    border-color: #739882;
  }
  .action-tile button.is-progressing::after,
  .dungeon-entry button.is-progressing::after,
  .small-button.is-progressing::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 5px;
    width: 100%;
    background:
      linear-gradient(
        90deg,
        #9dbd81,
        #d2a753,
        #efdb98);
    transform: scaleX(0);
    transform-origin: left;
    animation: action-progress 1.25s linear forwards;
  }
  @keyframes action-progress {
    to {
      transform: scaleX(1);
    }
  }
  .stat-pair,
  .stat-pair > span,
  .stat-pair > strong,
  .action-tile,
  .dungeon-entry,
  .widget-inner {
    position: relative;
  }
  .floating-number {
    position: absolute;
    top: var(--float-top,-18px);
    right: 0;
    z-index: var(--z-feedback);
    padding: 3px 8px;
    border-radius: 20px;
    background: #fffdf2f0;
    border: 1px solid #ded9a8;
    white-space: nowrap;
    pointer-events: none;
    font: 800 0.75rem var(--sans);
    box-shadow: 0 3px 10px #35493826;
    animation: floating-rise 1.25s ease-out forwards;
  }
  .float-exp {
    color: #946b23;
  }
  .float-gold {
    color: #a67a23;
  }
  .float-loss {
    color: #b65248;
  }
  .float-heal {
    color: #438d61;
  }
  .float-qi {
    color: #287c8a;
  }
  @keyframes floating-rise {
    0% {
      opacity: 0;
      transform: translateY(11px) scale(.94);
    }
    17% {
      opacity: 1;
      transform: translateY(0) scale(1.04);
    }
    80% {
      opacity: 1;
      transform: translateY(-19px) scale(1);
    }
    100% {
      opacity: 0;
      transform: translateY(-35px) scale(.97);
    }
  }
  .action-tile > .cost-chip {
    margin-top: 8px;
  }
  .craft-recipes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
  }
  .craft-recipe {
    min-width: 0;
    background:
      linear-gradient(
        180deg,
        #fffdf4,
        #f2f5e9);
    border: 1px solid #c4d3b9;
    padding: 10px 11px;
  }
  .recipe-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d6e0cf;
    margin-bottom: 7px;
  }
  .recipe-heading strong {
    font: 700 0.875rem var(--serif);
    color: #37715b;
  }
  .recipe-heading span {
    color: var(--muted);
    font-size: 0.75rem;
    text-align: right;
  }
  .recipe-ingredients {
    display: grid;
    gap: 6px;
  }
  .recipe-ingredient {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: #f9f9f0;
    border: 1px solid #e1e7d8;
    font-size: 0.75rem;
  }
  .recipe-ingredient span {
    color: #607965;
  }
  .recipe-ingredient strong {
    white-space: nowrap;
    color: #2a7756;
  }
  .recipe-ingredient.is-missing {
    background: #fff2e7;
    border-color: #e5c9aa;
  }
  .recipe-ingredient.is-missing strong {
    color: #aa6143;
  }
  .recipe-ingredient.is-ready {
    background: #eef6e9;
  }
  .shop-actions button:disabled {
    opacity: .88;
    background: #fff3e9;
    color: #94634e;
    border-color: #dcc3b5;
    cursor: not-allowed;
  }
  .shop-actions button:enabled {
    background: #d7ebda;
    color: #286c53;
  }
  .achievement-toast {
    position: fixed;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 32px));
    z-index: var(--z-toast);
    pointer-events: none;
    display: grid;
    justify-items: center;
    gap: 9px;
    text-align: center;
    padding: 30px 24px 27px;
    color: #705025;
    background:
      radial-gradient(
        ellipse at center,
        #fffcf0,
        #fff1ce 78%,
        #f6df9f);
    border: 2px solid #b89348;
    outline: 5px solid #fff5dcbb;
    box-shadow:
      0 0 0 10px #c9a15a4d,
      0 22px 70px #36271878,
      inset 0 0 0 5px #fff6d7;
    font-family: var(--serif);
  }
  .achievement-toast.is-visible {
    animation: achievement-entrance .38s cubic-bezier(.2, 1.4, .45, 1) both;
  }
  .achievement-emblem {
    font-size: 2.125rem;
    line-height: 1;
    color: #b4823f;
    text-shadow: 0 2px #fff;
  }
  #achievement-title {
    font-size: clamp(1.125rem, 4.5vw, 1.5625rem);
    line-height: 1.6;
    color: #80532b;
  }
  #achievement-detail {
    font: 700 0.75rem/1.8 var(--sans);
    color: #8a6a40;
    word-break: keep-all;
  }
  @keyframes achievement-entrance {
    from {
      opacity: 0;
      transform: translate(-50%, -42%) scale(.9);
      filter: brightness(1.2);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
      filter: brightness(1);
    }
  }
  html[data-theme] .craft-recipe {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme] .recipe-ingredient {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme] .recipe-heading strong {
    color: var(--heading);
  }
  html[data-theme] .recipe-ingredient span {
    color: var(--text);
  }
  html[data-theme] .recipe-ingredient.is-missing {
    background: var(--danger-bg);
    border-color: var(--line);
  }
  html[data-theme] .recipe-ingredient.is-missing strong {
    color: var(--danger-text);
  }
  html[data-theme] .recipe-ingredient.is-ready strong {
    color: var(--heading);
  }
  html[data-theme] .cost-chip {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .cost-chip.gold-cost {
    background: var(--surface);
    color: var(--text);
  }
  html[data-theme] .cost-chip.is-unaffordable {
    background: var(--danger-bg);
    color: var(--danger-text);
  }
  html[data-theme] .achievement-toast {
    background: var(--surface);
    border-color: var(--line);
    color: var(--text);
  }
  html[data-theme] #achievement-title {
    color: var(--text);
  }
  html[data-theme] #achievement-detail {
    color: var(--text);
  }
  .action-tile > button[data-action] {
    min-height: 37px;
    line-height: 1.45;
  }
  .action-tile button.is-progressing,
  .dungeon-entry button.is-progressing {
    white-space: normal;
    word-break: keep-all;
  }
  .save-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 12px 0 4px;
  }
  .save-controls .small-button {
    min-width: 0;
    font-size: 0.75rem;
    padding: 8px 2px;
  }
  .onboarding-restore {
    min-height: 44px;
    width: 100%;
    border: 0;
    background: none;
    color: var(--accent);
    font-size: 0.75rem;
    padding: 9px 4px;
    text-decoration: underline;
    font-weight: 800;
  }
  .class-passive {
    background: #f4f4e8;
    color: #48745c;
    padding: 9px;
    margin: 0 0 12px;
    font-size: 0.75rem;
    line-height: 1.7;
    border: 1px dashed #c0d4bb;
    word-break: keep-all;
  }
  .batch-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: #faf9ed;
    border: 1px solid #d7dfc7;
  }
  .batch-bar > span {
    font: 700 0.75rem var(--serif);
    color: #3d795e;
  }
  .batch-bar > small {
    flex: 1 1 180px;
    color: #72816c;
    font-size: 0.75rem;
  }
  .batch-switch {
    display: flex;
    gap: 0;
    border: 1px solid #b2cbaf;
    border-radius: 5px;
    overflow: hidden;
  }
  .batch-switch button {
    padding: 7px 10px;
    background: #fffdf2;
    border: 0;
    border-right: 1px solid #bfd5b9;
    color: #65816c;
    font-size: 0.75rem;
    font-weight: 800;
  }
  .batch-switch button:last-child {
    border: 0;
  }
  .batch-switch button[aria-pressed=true] {
    background: #397c62;
    color: white;
  }
  #stop-auto {
    padding: 8px;
    border: 1px solid #bb8e76;
    background: #fff1e3;
    color: #945c46;
    font-size: 0.75rem;
    font-weight: 800;
  }
  .mastery-hint {
    margin-top: -5px;
    background: #f9f7ed;
    border: 1px dashed #d6dfc6;
    padding: 7px 10px;
    color: #71846a;
    font-size: 0.75rem;
    line-height: 1.8;
    word-break: keep-all;
  }
  .gate-banner {
    padding: 11px 13px;
    margin: 0 0 12px;
    background:
      linear-gradient(
        90deg,
        #fff0cf,
        #fff8e7);
    border: 1px solid #c99f64;
    box-shadow: inset 4px 0 #ad764b;
  }
  .gate-banner strong {
    font: 700 0.9375rem var(--serif);
    color: #975037;
  }
  .gate-banner p {
    font-size: 0.75rem;
    margin: 5px 0 0;
    color: #8e6d53;
    line-height: 1.7;
  }
  .craft-recipe {
    display: flex;
    flex-direction: column;
    min-height: 226px;
  }
  .craft-recipe .recipe-ingredients {
    flex: 1;
  }
  .recipe-story {
    margin: 3px 0 8px;
    font-size: 0.75rem;
    color: #8a855d;
    line-height: 1.7;
  }
  .recipe-action {
    width: 100%;
    margin-top: 12px;
    border: 1px solid #35765d;
    background: linear-gradient(#70ad8b, #2d745a);
    color: #fffef5;
    padding: 10px 7px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.5;
    min-height: 44px;
    cursor: pointer;
  }
  .recipe-action:disabled {
    background: #eee4d9;
    border-color: #ceb9a8;
    color: #927360;
    cursor: not-allowed;
    opacity: .9;
  }
  .recipe-progress {
    display: block;
    margin: 7px 0 0;
    text-align: center;
    color: #827b61;
    font-size: 0.75rem;
  }
  .moon-recipe {
    border-color: #c7b082;
    background: linear-gradient(#fff7e1, #f0e8d4);
  }
  .moon-recipe .recipe-heading strong {
    color: #8f6c3c;
  }
  .potion-shop {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 13px;
  }
  .potion-shop h3 {
    grid-column: 1/-1;
    margin: 0 0 2px;
    color: #43755d;
    font: 700 0.8125rem var(--serif);
  }
  .potion-shop [hidden] {
    display: none;
  }
  .market-section {
    margin-top: 13px;
    background: #f8f9ed;
    border: 1px solid #d8e2d1;
    padding: 12px;
  }
  .market-section h3 {
    color: #4f7b60;
    font: 700 0.8125rem var(--serif);
    margin: 0;
  }
  .market-section p {
    margin: 5px 0;
  }
  .market-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .market-actions button {
    padding: 8px 4px;
    border: 1px solid #bdcdb1;
    background: #fffef6;
    color: #436a55;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.5;
  }
  .market-actions button:disabled {
    opacity: .55;
  }
  .empty-state {
    grid-column: 1/-1;
    padding: 16px 12px;
    margin: 0;
    background: #f8f9ee;
    text-align: center;
    color: #7f8872;
    font: 700 0.75rem/1.9 var(--serif);
    border: 1px dashed #d1decd;
  }
  .fate-dialog,
  .save-dialog {
    width: min(465px, calc(100% - 24px));
    max-height: 85dvh;
    overflow-y: auto;
    padding: 0;
    border: 2px solid #aa986d;
    box-shadow: 0 16px 70px #142c2c88;
    background: #fffdf3;
    color: #495f4b;
  }
  .fate-dialog::backdrop,
  .save-dialog::backdrop {
    background: #142d2abb;
    backdrop-filter: blur(4px);
  }
  .fate-heading {
    padding: 22px 20px 12px;
    text-align: center;
    background: linear-gradient(#f5f0d4, #fff8e7);
    border-bottom: 1px solid #e1cc9a;
  }
  .fate-heading span {
    font: 800 0.8125rem var(--serif);
    color: #ba7a4b;
    letter-spacing: .1em;
  }
  .fate-heading h2 {
    font: 700 1.4375rem/1.5 var(--display);
    color: #7c6349;
    margin: 9px 0 3px;
  }
  .fate-dialog #fate-story {
    padding: 20px 24px 12px;
    margin: 0;
    text-align: center;
    font: 700 0.875rem/2 var(--serif);
    color: #5b6958;
    word-break: keep-all;
  }
  .fate-choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 8px 24px 23px;
  }
  .fate-choices button {
    padding: 13px 9px;
    border: 1px solid #b5c9af;
    color: #32644e;
    background: #eff4e7;
    font: 700 0.75rem/1.7 var(--serif);
    word-break: keep-all;
  }
  .fate-choices button:first-child {
    background: #fbf0df;
    color: #966442;
    border-color: #d0b18d;
  }
  .save-dialog {
    padding-bottom: 18px;
  }
  .save-dialog > .widget-intro,
  .save-dialog > label,
  .save-dialog > .save-status {
    display: block;
    padding: 0 18px;
    margin: 12px 0 6px;
  }
  .save-dialog > label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #3e7058;
  }
  #save-code {
    display: block;
    width: calc(100% - 36px);
    box-sizing: border-box;
    margin: 0 18px;
    font: 0.75rem/1.5 ui-monospace, monospace;
    resize: vertical;
    min-height: 110px;
    max-height: 32dvh;
    border: 1px solid #bacbad;
    border-radius: 4px;
    padding: 10px;
    color: #325a49;
    background: #fffef8;
    overflow-wrap: anywhere;
  }
  .save-dialog > .save-status {
    font-size: 0.75rem;
    color: #926b4c;
    line-height: 1.7;
    min-height: 20px;
  }
  .save-dialog-actions {
    display: flex;
    gap: 7px;
    padding: 6px 18px 0;
  }
  .save-dialog-actions button {
    flex: 1;
    padding: 10px 6px;
    font-weight: 800;
    font-size: 0.75rem;
    border: 1px solid #528069;
    color: #fffbec;
    background: #438068;
  }
  .save-dialog-actions button:last-child {
    background: #9f8051;
    border-color: #876948;
  }
  html[data-theme] .class-passive {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .batch-bar {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .mastery-hint {
    background: var(--surface);
    color: var(--muted);
    border-color: var(--line);
  }
  html[data-theme] .market-section {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .empty-state {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .batch-bar > span {
    color: var(--text);
  }
  html[data-theme] .batch-bar > small {
    color: var(--muted);
  }
  html[data-theme] .market-section h3 {
    color: var(--heading);
  }
  html[data-theme] .craft-recipe .recipe-heading strong {
    color: var(--heading);
  }
  html[data-theme] .batch-switch button {
    background: var(--button-bg);
    color: var(--button-text);
    border-color: var(--line);
  }
  html[data-theme] .market-actions button {
    background: var(--button-bg);
    color: var(--button-text);
    border-color: var(--line);
  }
  html[data-theme] .batch-switch button[aria-pressed=true] {
    background: var(--primary-bg);
  }
  html[data-theme] .moon-recipe {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme] .gate-banner {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-theme] .gate-banner strong {
    color: var(--heading);
  }
  html[data-theme] .gate-banner p {
    color: var(--text);
  }
  html[data-theme] .recipe-story {
    color: var(--text);
  }
  html[data-theme] .recipe-progress {
    color: var(--text);
  }
  html[data-theme] .fate-dialog {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .save-dialog {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .fate-heading {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-theme] .fate-heading h2 {
    color: var(--heading);
  }
  html[data-theme] .fate-dialog #fate-story {
    color: var(--text);
  }
  html[data-theme] .save-dialog > label {
    color: var(--text);
  }
  html[data-theme] #save-code {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
  }
  [role=radiogroup] [role=radio]:focus-visible {
    outline: 3px solid #cf9e50;
    outline-offset: 3px;
    position: relative;
    z-index: 2;
  }
  [role=radiogroup] [role=radio][aria-checked=true] {
    font-weight: 800;
  }
  #character {
    position: relative;
    overflow: visible;
  }
  #mobile-status {
    position: sticky;
  }
  #character > .floating-number {
    top: var(--float-top,-18px);
    right: 12px;
    z-index: var(--z-feedback);
  }
  #mobile-status > .floating-number {
    top: var(--float-top,-18px);
    right: 12px;
    z-index: var(--z-feedback);
  }
  .startup-error {
    box-sizing: border-box;
    position: fixed;
    z-index: var(--z-critical);
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, calc(100vw - 28px));
    border: 2px solid #b04c49;
    border-radius: 6px;
    background: #fff3e7;
    color: #8a2727;
    box-shadow: 0 12px 40px #231d1d55;
    padding: 16px 18px;
    text-align: center;
    font: 700 0.875rem/1.65 var(--sans);
  }
  @media (max-width: 780px) {
    .right-rail .log-panel {
      height: 195px;
      max-height: 195px;
    }
    .right-rail .log-panel.collapsed {
      height: auto;
    }
    .craft-recipes {
      gap: 8px;
      grid-template-columns: 1fr;
    }
    .achievement-toast {
      top: 41%;
      padding: 24px 16px;
    }
    .cost-chip {
      font-size: 0.75rem;
      padding: 3px 6px;
    }
    .action-tile .cost-chip {
      font-size: 0.75rem;
    }
    .market-actions {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .batch-bar {
      gap: 7px;
      padding: 8px;
    }
    .batch-bar > small {
      flex-basis: 100%;
    }
    .save-controls .small-button {
      font-size: 0.75rem;
    }
    .fate-heading h2 {
      font-size: 1.25rem;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .right-rail .event-log li.log-fresh::before {
      animation: none;
    }
    .meter > span {
      transition: none;
    }
    .meter.is-danger > span,
    .floating-number,
    .achievement-toast.is-visible,
    .action-tile button.is-progressing::after,
    .dungeon-entry button.is-progressing::after,
    .small-button.is-progressing::after {
      animation: none;
    }
    .action-tile button.is-progressing::after,
    .dungeon-entry button.is-progressing::after,
    .small-button.is-progressing::after {
      transform: scaleX(1);
    }
    .fate-dialog,
    .save-dialog {
      scroll-behavior: auto;
    }
    #character > .floating-number,
    #mobile-status > .floating-number {
      animation: none;
    }
  }
  @media (hover: hover) {
    .market-actions button:enabled:hover {
      background: #dfecdd;
    }
    .fate-choices button:hover {
      filter: brightness(.96);
    }
  }
  .right-rail .log-panel {
    display: flex;
    flex-direction: column;
    min-height: 430px;
    max-height: calc(100vh - 35px);
    border: 1px solid #aabfa8;
    box-shadow: 0 7px 18px #334d3b21;
  }
  .log-panel .panel-heading {
    position: relative;
    display: flex;
    flex-shrink: 0;
  }
  .log-panel .panel-heading h2 {
    font-size: 0.8125rem;
  }
  #log-toggle {
    font-size: 0.75rem;
    border: 1px solid #9cbb9f;
    background: #f9fff2;
    color: #426951;
    padding: 5px 7px;
    font-weight: 700;
    white-space: nowrap;
  }
  .right-rail .event-log {
    flex: 1;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding: 13px 13px 16px;
    scrollbar-width: thin;
  }
  .right-rail .event-log li:first-child {
    font-weight: 800;
    color: #326a54;
    background: #f0f7e866;
    margin: -3px -4px 5px;
    padding: 9px 4px 9px 19px;
    border-radius: 3px;
  }
  .log-panel.collapsed .event-log {
    display: none;
  }
  .log-panel.collapsed {
    min-height: 0;
  }
  html[data-theme] .right-rail .event-log li:first-child {
    color: var(--text);
    background: var(--surface);
  }
  @media (max-width: 780px) {
    .log-panel.collapsed .event-log {
      display: none;
    }
  }
}
