#mola-fisi {
  --fis-brown: #4a281b;
  --fis-paper: #f8f1e5;
  --fis-rule: #a48f80;
  --fis-mono: ui-monospace, "Courier New", monospace;
  position: fixed;
  inset: 0;
  width: min(394px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  color: var(--fis-brown);
  background: transparent;
  font-family: var(--sans, system-ui), sans-serif;
  box-shadow: 0 18px 60px #29180d40;
}
#mola-fisi::backdrop { background: rgb(41 26 18 / 70%); }
html:has(#mola-fisi[open]) { overflow: hidden; }
.fis-paper {
  position: relative;
  isolation: isolate;
  margin-bottom: 8px;
  padding: 14px clamp(18px, 5vw, 32px) 21px;
  background: var(--fis-paper);
  color: var(--fis-brown);
}
.fis-paper::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  height: 8px;
  background: linear-gradient(135deg, var(--fis-paper) 25%, transparent 25%) 0 0 / 16px 16px,
              linear-gradient(225deg, var(--fis-paper) 25%, transparent 25%) 0 0 / 16px 16px;
}
.fis-top,.fis-meta,.fis-options,.fis-result > div,.fis-actions { display: flex; align-items: center; }
.fis-top,.fis-meta { justify-content: space-between; }
.fis-check { width: 64px; height: 16px; background: repeating-conic-gradient(#f3d273 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
#mola-fisi button { cursor: pointer; font: inherit; }
#mola-fisi .fis-close { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; color: inherit; background: transparent; border-radius: 50%; }
.fis-meta,.fis-end,.fis-print-mood,.fis-result > div > span { font-family: var(--fis-mono); }
.fis-meta { padding-top: 10px; border-top: 1px dashed var(--fis-rule); font-size: 11px; line-height: 1.4; letter-spacing: .07em; }
#mola-fisi h2 { margin: 18px 0; font-family: var(--display, Georgia), serif; font-size: clamp(40px, 8vw, 56px); line-height: 1; letter-spacing: -.045em; color: inherit; }
.fis-select { min-width: 0; margin: 0; padding: 0; border: 0; }
.fis-select legend { margin-bottom: 5px; padding: 0; font-size: 13px; font-weight: 650; }
.fis-options { flex-wrap: wrap; gap: 5px; }
.fis-options label { position: relative; display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.fis-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fis-options span { padding: 7px 10px; border: 1px solid var(--fis-rule); border-radius: 4px; font-size: 13px; line-height: 1.2; }
.fis-options input:checked + span { border-color: var(--fis-brown); background: #a9c7e4; font-weight: 700; }
.fis-options input:focus-visible + span,#mola-fisi button:focus-visible { outline: 2px solid var(--fis-brown); outline-offset: 3px; }
.fis-result { margin: 15px 0 12px; padding: 14px 0; border-block: 1px dashed var(--fis-rule); }
.fis-result > div { gap: 16px; padding: 3px 0; }
.fis-result > div > span { white-space: nowrap; font-size: 13px; }
.fis-result strong { font-size: 17px; line-height: 1.3; }
.fis-actions { gap: 9px; flex-wrap: wrap; }
#mola-fisi .fis-draw { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--fis-brown); border-radius: 5px; background: var(--fis-brown); color: var(--fis-paper); font-weight: 650; }
.fis-draw span { font-family: system-ui, sans-serif; }
#mola-fisi .fis-print { min-height: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--fis-brown); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.fis-end { margin: 17px 0 0; font-size: 12px; text-align: center; }
.fis-print-mood { display: none; }
@media (hover: hover) {
  #mola-fisi .fis-close:hover,.fis-options label:hover span { background: #f3d273; }
  #mola-fisi .fis-draw:hover { background: #f3d273; color: var(--fis-brown); }
}
@media print {
  html:has(#mola-fisi[open]),body:has(#mola-fisi[open]) { overflow: visible !important; height: auto !important; margin: 0 !important; background: white !important; }
  body:has(#mola-fisi[open]) > :not(#mola-fisi) { display: none !important; }
  #mola-fisi[open] { position: static !important; inset: auto; display: block !important; width: min(80mm, 100%); max-height: none; margin: 0 auto; overflow: visible; box-shadow: none; }
  #mola-fisi::backdrop { background: transparent; }
  .fis-paper { margin: 0; padding: 6mm 2mm; color: black; background: white; break-inside: avoid; }
  #mola-fisi .fis-top,#mola-fisi .fis-select,#mola-fisi .fis-actions,.fis-paper::after { display: none; }
  .fis-print-mood { display: block; margin: 1em 0; font-size: 10pt; }
}
