@font-face {
  font-family: "Baloo 2";
  src: url("../resources/fonts/Baloo2-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Baloo 2";
  src: url("../resources/fonts/Baloo2-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
}
:root {
  color-scheme: dark;
  --bg: rgb(32, 32, 28);
  --surface: #181b16;
  --surface-raised: rgb(33, 33, 29);
  --surface-soft: #262b22;
  --text: #eef4df;
  --text-soft: #cbd5bc;
  --text-muted: #88927e;
  --green: rgb(122, 177, 75);
  --green-14: rgba(122, 177, 75, 0.14);
  --green-bright: rgb(168, 220, 77);
  --yellow: #d6ae3d;
  --red: #e05b52;
  --red-85: rgba(224, 91, 82, 0.85);
  --content-width: 20.5rem;
  --page-gap: 1rem;
  --section-radius: 8px;
  --action-bar-height: 5.4rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --section-bg: rgb(48, 46, 43);
  --action-button-bg: rgb(33, 33, 29);
  --green-soft: rgb(115, 149, 82);
  --yellow-soft: rgb(235, 236, 208);
  --yellow-soft-selected: rgb(152.6, 217.6, 187.2);
  --green-soft-selected: rgb(128.6, 200.2, 162);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 20rem;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Baloo 2", sans-serif;
  line-height: 1.15;
}

button, input, select {
  font: inherit;
}

button, label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

body.app-body button:focus-visible,
body.app-body a:focus-visible,
body.app-body input:focus-visible,
body.app-body select:focus-visible,
body.app-body label:has(input:focus-visible) {
  outline: none;
  box-shadow: none;
}

img {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app {
  min-height: 100svh;
  padding-bottom: calc(var(--action-bar-height) + var(--safe-bottom) + 1.5rem);
}

#quality-warning {
  display: none;
  width: min(100% - 1.25rem, var(--content-width));
  margin-inline: auto;
  padding: 0.7rem 0.3rem;
  padding-bottom: 0;
  color: var(--red-85);
}

#quality-warning.on {
  display: block;
}

.app-content {
  display: grid;
  gap: var(--page-gap);
  width: min(100% - 1.25rem, var(--content-width));
  margin-inline: auto;
}

.tool-section {
  position: relative;
  overflow: hidden;
  padding: clamp(1rem, 3.5vw, 1.35rem);
  border-radius: var(--section-radius);
  background: var(--section-bg);
  box-shadow: 0 1.15rem 2.8rem -2rem rgba(0, 0, 0, 0.42);
  transition: opacity 180ms ease, border-color 180ms ease, background 180ms ease;
}

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.section-heading-inline {
  align-items: center;
}

.section-heading h1, .section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.18rem, 4.5vw, 1.42rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.section-kicker {
  margin: 0;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.optional-title {
  margin-bottom: 0.6rem;
}

.section-kicker.bottom-kicker {
  margin: 1rem 0 0 0;
}

.status-ready {
  color: var(--green-bright);
  border-color: rgba(168, 220, 77, 0.28);
  background: rgba(130, 187, 47, 0.1);
}

.status-idle, .status-optional {
  color: var(--text-muted);
  border-color: rgba(136, 146, 126, 0.18);
  background: rgba(136, 146, 126, 0.07);
}

.status-unknown {
  color: #f0cf72;
  border-color: rgba(214, 174, 61, 0.28);
  background: rgba(214, 174, 61, 0.09);
}

.is-locked {
  opacity: 0.46;
}

.is-locked::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  content: "";
  cursor: default;
  background: rgba(10, 12, 9, 0.08);
}

.app.has-position .source-section,
.app.has-position .position-section,
.app.position-valid .turn-section,
.app.position-valid .castling-section,
.app.position-valid .advanced-section,
.app.fen-valid .action-button {
  opacity: 1;
}

.app.has-position .source-section::after,
.app.has-position .position-section::after,
.app.position-valid .turn-section::after,
.app.position-valid .castling-section::after,
.app.position-valid .advanced-section::after {
  display: none;
}

.app.has-image .import-section {
  padding-block: 0.8rem;
}

.app.has-image .import-section .section-copy,
.app.has-image .import-section .section-heading,
.app.has-image .import-actions {
  display: none;
}

.app.has-image .import-compact {
  display: flex;
}

.app.has-fen .action-button {
  opacity: 1;
  cursor: pointer;
  filter: none;
}

.drop-zone.is-dragging::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: rgba(130, 187, 47, 0.1);
  margin: 2px;
  border: 2px dashed rgba(168, 220, 77, 0.35);
  border-radius: 1rem;
}

.drop-zone.is-dragging::after {
  content: "Drop screenshot";
  position: fixed;
  inset: 0;
  z-index: 101;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: white;
  font-size: 2rem;
  font-weight: 400;
}

.import-section {
  margin-top: 0.7rem;
}

.import-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.button {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
}

.button-primary {
  color: #17200e;
  background: var(--green);
}

.button-secondary {
  color: var(--text);
  border-color: rgba(168, 220, 77, 0.24);
  background: rgba(130, 187, 47, 0.07);
}

.button-icon {
  font-size: 1.22rem;
  line-height: 1;
}

.camera-glyph {
  position: relative;
  display: inline-block;
  width: 1.2rem;
  height: 0.9rem;
  border: 0.12rem solid currentColor;
  border-radius: 0.2rem;
}

.camera-glyph::before {
  position: absolute;
  top: -0.33rem;
  left: 0.2rem;
  width: 0.42rem;
  height: 0.25rem;
  border: 0.1rem solid currentColor;
  border-bottom: 0;
  border-radius: 0.12rem 0.12rem 0 0;
  content: "";
}

.camera-glyph::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.34rem;
  height: 0.34rem;
  border: 0.1rem solid currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.drop-label {
  cursor: default;
  border: 2px dashed rgba(168, 220, 77, 0.35);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
}

.import-compact {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.text-button {
  padding: 0.4rem 0.2rem;
  border-radius: var(--section-radius);
  border: 0;
  color: var(--green-bright);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.compact-divider {
  width: 1px;
  height: 1rem;
  background: rgba(168, 220, 77, 0.24);
}

.square-shell {
  width: 100%;
  aspect-ratio: 1;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: var(--section-radius);
  background: #0c0e0b;
}

.source-board-shell {
  position: relative;
  display: grid;
  padding: 0;
  border: 1px dashed rgba(168, 220, 77, 0.24);
  cursor: default;
  place-items: center;
}

.source-placeholder {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  color: var(--text-muted);
  text-align: center;
}

.source-placeholder-icon {
  width: 1.8rem;
  height: 1.35rem;
  color: var(--green);
  opacity: 0.7;
}

.source-board-image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-board-view {
  display: none;
  width: 100%;
  height: 100%;
}

.source-section.has-image .source-board-view {
  display: block;
}
.source-section.has-image .source-board-image {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
}
.source-section.has-image .source-placeholder {
  display: none;
}

.live-board-shell {
  position: relative;
  border: 0.2rem solid rgba(136, 146, 126, 0.34);
  box-shadow: 0 0 0 0.25rem rgba(136, 146, 126, 0.05);
}

.live-board-shell.is-valid {
  border-color: var(--green);
}

.live-board-shell.is-warning {
  border-color: var(--yellow);
}

.live-board-shell.is-error {
  border-color: rgba(224, 91, 82, 0.85);
}

.chess-board {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
}

.board-square {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: var(--yellow-soft);
  cursor: pointer;
  color: black;
}

.board-square:nth-child(16n+2),
.board-square:nth-child(16n+4),
.board-square:nth-child(16n+6),
.board-square:nth-child(16n+8),
.board-square:nth-child(16n+9),
.board-square:nth-child(16n+11),
.board-square:nth-child(16n+13),
.board-square:nth-child(16n+15) {
  background: var(--green-soft);
}

.board-square.is-last-move {
  background: var(--yellow-soft-selected);
}

.board-square.is-last-move:nth-child(16n+2),
.board-square.is-last-move:nth-child(16n+4),
.board-square.is-last-move:nth-child(16n+6),
.board-square.is-last-move:nth-child(16n+8),
.board-square.is-last-move:nth-child(16n+9),
.board-square.is-last-move:nth-child(16n+11),
.board-square.is-last-move:nth-child(16n+13),
.board-square.is-last-move:nth-child(16n+15) {
  background: var(--green-soft-selected);
}

.board-square.is-warning::after {
  content: "";
  position: absolute;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red-85);
  left: 50%;
  bottom: 5%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.board-heading {
  position: relative;
}

.board-en-passant {
  margin-top: auto;
  margin-bottom: 0.2rem;
  margin-right: 0.3rem;
  z-index: 5;
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.7;
  pointer-events: none;
  visibility: hidden;
}

.board-en-passant.is-visible {
  visibility: visible;
}

.board-processing {
  position: absolute;
  inset: -0.4rem;
  display: none;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--section-radius);
  color: var(--text);
  background: rgba(11, 13, 10, 0.78);
  backdrop-filter: blur(0.25rem);
  font-weight: 600;
}

.app.is-processing .board-processing {
  display: flex;
}

.processing-spinner {
  width: 1.3rem;
  height: 1.3rem;
  border: 0.16rem solid rgba(168, 220, 77, 0.24);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.message-section.is-valid .message-dot {
  background: var(--green);
}

.message-section.is-warning .message-dot {
  background: var(--yellow);
}

.message-section.is-error .message-dot {
  background: var(--red);
}

.message {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.message-dot {
  width: 0.52rem;
  height: 0.52rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-muted);
}

.interaction-hint {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.control-fieldset {
  min-width: 0;
  padding: 0;
  margin: 1rem 0 0;
  border: 0;
}

.segmented-control {
  display: grid;
  gap: 0.55rem;
  padding: 0.35rem;
  border: 1px solid rgba(168, 220, 77, 0.15);
  border-radius: 0.92rem;
  background: rgba(255, 255, 255, 0.025);
}

.segmented-control-two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented-control label, .toggle-chip {
  cursor: pointer;
}

.segmented-control input, .toggle-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span, .toggle-chip span {
  display: flex;
  min-height: 2.2rem;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 0.66rem;
  color: var(--text-soft);
  background: transparent;
  font-weight: 600;
}

.segmented-control input:checked + span, .toggle-chip input:checked + span {
  color: #16200d;
  background: var(--green);
}

.piece-dot {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
}

.piece-dot-light {
  background: #f0f2e7;
}

.piece-dot-dark {
  background: #181b17;
  box-shadow: 0 0 0 0.1rem rgba(255, 255, 255, 0.08);
}

.castling-controls {
  display: grid;
  gap: 0.72rem;
}

.castling-row {
  display: grid;
  grid-template-columns: minmax(5.4rem, 1fr) minmax(4.6rem, 0.75fr) minmax(5.3rem, 0.9fr);
  gap: 0.55rem;
  align-items: center;
}

.castling-side {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-soft);
  font-weight: 600;
}

.toggle-chip span {
  min-height: 2.6rem;
  border-color: var(--green-14);
  background: rgba(255, 255, 255, 0.025);
}

.advanced-controls {
  display: grid;
  margin-top: 0.6rem;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 0.82fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(168, 220, 77, 0.1);
}

.form-row:last-child {
  border-bottom: 0;
}

.form-label {
  display: grid;
  gap: 0.18rem;
}

.form-label label {
  color: var(--text);
  font-weight: 600;
}

.form-label small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

select, input[type=number] {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(168, 220, 77, 0.16);
  border-radius: 0.68rem;
  color: var(--text);
  background: var(--surface-raised);
}

select:disabled, input:disabled {
  color: var(--text-muted);
}

.segmented-control.is-valid,
#en-passant.is-valid {
  border-color: rgba(122, 177, 75, 0.65);
}

.segmented-control.is-warning,
#en-passant.is-warning {
  border-color: rgba(214, 174, 61, 0.8);
  box-shadow: 0 0 0 1px rgba(214, 174, 61, 0.12);
}

.segmented-control.is-invalid,
#en-passant.is-invalid {
  border-color: rgba(224, 91, 82, 0.85);
  box-shadow: 0 0 0 1px rgba(224, 91, 82, 0.14);
}

.toggle-chip.is-valid span {
  border-color: rgba(122, 177, 75, 0.65);
}

.toggle-chip.is-warning span {
  border-color: rgba(214, 174, 61, 0.8);
}

.toggle-chip.is-invalid span {
  border-color: rgba(224, 91, 82, 0.85);
}

.message-section {
  position: relative;
  overflow: hidden;
  padding: 0px, clamp(1rem, 3.5vw, 1.35rem);
  transition: opacity 180ms ease, border-color 180ms ease, background 180ms ease;
}

.action-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: grid;
  min-height: calc(var(--action-bar-height) + var(--safe-bottom));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: start;
  padding: 0.72rem max(0.7rem, (100vw - var(--content-width)) / 2) calc(0.72rem + var(--safe-bottom));
  border-top: 1px solid rgba(168, 220, 77, 0.14);
  background: var(--section-bg);
  box-shadow: 0 -1rem 2.7rem -1.65rem rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(1rem) saturate(120%);
}

.action-button {
  display: inline-flex;
  min-width: 0;
  min-height: 3.5rem;
  gap: 0.42rem;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.5rem;
  border: none;
  border-radius: var(--section-radius);
  color: var(--green-bright);
  background: var(--action-button-bg);
  font-size: clamp(0.72rem, 3vw, 0.9rem);
  font-weight: 600;
  cursor: pointer;
  opacity: 1;
  filter: none;
}

.action-button:disabled {
  cursor: default;
  opacity: 0.42;
  filter: grayscale(0.4);
}

.action-icon {
  color: var(--green-bright);
  font-size: 1.14rem;
}

.copy-glyph {
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  border: 0.1rem solid var(--green-bright);
  border-radius: 0.14rem;
}

.copy-glyph::before {
  position: absolute;
  top: -0.34rem;
  left: -0.34rem;
  width: 0.72rem;
  height: 0.72rem;
  border: 0.1rem solid rgba(168, 220, 77, 0.62);
  border-radius: 0.14rem;
  content: "";
}

.board-piece {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.board-piece-un,
.board-piece-wK,
.board-piece-wQ,
.board-piece-wR,
.board-piece-wB,
.board-piece-wN,
.board-piece-wP {
  fill: #f5f5f5;
  stroke: #202020;
  stroke-width: 1px;
  paint-order: stroke fill;
}

.board-piece-bK,
.board-piece-bQ,
.board-piece-bR,
.board-piece-bB,
.board-piece-bN,
.board-piece-bP {
  fill: #202020;
}

.piece-picker {
  position: fixed;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(6, 2.8rem);
  gap: 0.35rem;
  padding: 0.6rem;
  background: var(--section-bg);
  border-radius: var(--section-radius);
  border: none;
}

.piece-picker[hidden] {
  display: none;
}

.piece-picker button {
  width: 2.8rem;
  height: 2.8rem;
  background: none;
  border-radius: var(--section-radius);
  border: none;
  cursor: pointer;
}

.piece-picker button.piece-picker-remove {
  grid-column: 1/-1;
  width: auto !important;
  border: 0.1px solid gray;
}

.board-square.is-selected {
  outline: 3px solid var(--red);
  outline-offset: -3px;
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg);
  opacity: 1;
  transition: opacity 700ms ease;
}

#loading-screen.is-hiding {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 33rem) {
  .section-heading {
    gap: 0.7rem;
  }
  .castling-row {
    grid-template-columns: minmax(4.8rem, 0.9fr) minmax(4rem, 0.72fr) minmax(4.8rem, 0.82fr);
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.62rem;
  }
}
@media (max-width: 24rem) {
  .import-actions {
    grid-template-columns: 1fr;
  }
  .action-button {
    flex-direction: column;
    gap: 0.16rem;
    font-size: 0.68rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.brand {
  display: none;
  color: var(--green-soft);
  font-size: 0.92rem;
  justify-self: center;
  font-weight: 600;
  text-decoration: none;
}

#goto-site-button {
  display: none;
  color: var(--green-soft);
  font-size: 0.92rem;
  justify-self: center;
}

#source-section .sidepanel-heading {
  justify-content: space-between;
  width: 100%;
  display: none;
}

.app.app-type-web {
  --content-width: 26rem;
}
.app.app-type-web .source-section,
.app.app-type-web .position-section {
  width: min(100%, 18rem);
  margin-inline: auto;
}
.app.app-type-web .import-actions {
  display: none;
}
.app.app-type-web .import-compact {
  display: flex;
}
.app.app-type-web .brand {
  display: inline-flex;
}

@media (min-width: 768px) {
  .app.app-type-web {
    --content-width: min(100%, 1024px);
  }
  .app.app-type-web .app-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "import import" "source position" "castling turn" "advanced advanced" "brand brand";
  }
  .app.app-type-web .app-content .import-section {
    grid-area: import;
  }
  .app.app-type-web .app-content .source-section {
    grid-area: source;
  }
  .app.app-type-web .app-content .position-section {
    grid-area: position;
  }
  .app.app-type-web .app-content .turn-section {
    grid-area: turn;
  }
  .app.app-type-web .app-content .castling-section {
    grid-area: castling;
  }
  .app.app-type-web .app-content .advanced-section {
    grid-area: advanced;
  }
  .app.app-type-web .app-content .brand {
    grid-area: brand;
  }
  .app.app-type-web .app-content .source-section,
  .app.app-type-web .app-content .position-section {
    width: 100%;
  }
  .app.app-type-web .app-content .source-section {
    display: flex;
    flex-direction: column-reverse;
    gap: 1rem;
  }
}
#sidepanel-capture {
  position: relative;
  padding: 0.8rem 0.4rem;
  padding-right: 0.9rem;
  margin-left: -0.64rem;
  border-radius: var(--section-radius);
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

#sidepanel-capture::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--section-radius);
  pointer-events: none;
}

#sidepanel-capture:hover::after {
  background: rgba(255, 255, 255, 0.1);
}

#sidepanel-capture .capture-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  fill: none;
  stroke: var(--green-soft);
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#source-section.is-collapsed .source-board-shell {
  display: none;
}

.app.app-type-sidepanel #quality-warning {
  transform: translateY(0.6rem);
  padding: 0;
  padding-left: 0.3rem;
}
.app.app-type-sidepanel #import-section {
  display: none;
}
.app.app-type-sidepanel #sidepanel-capture {
  display: inline-flex;
}
.app.app-type-sidepanel #goto-site-button {
  display: inline-flex;
}
.app.app-type-sidepanel #source-section {
  margin-top: 1rem;
  padding-top: 0.52rem;
}
.app.app-type-sidepanel #source-section .web-heading {
  display: none;
}
.app.app-type-sidepanel #source-section .sidepanel-heading {
  display: flex;
}
.app.app-type-sidepanel #source-section .sidepanel-collapsed-src {
  display: inline;
}
.app.app-type-sidepanel #source-section .source-board-shell {
  margin-bottom: 0.2rem;
}
.app.app-type-sidepanel #source-section.is-collapsed {
  padding-bottom: 0.52rem;
}
.app.app-type-sidepanel #source-section:not(.is-collapsed) {
  padding-bottom: 1.2rem;
}
.app.app-type-sidepanel .side-panel-show {
  font-weight: 400;
}

html.popup-frame,
body.popup-body {
  width: fit-content;
  height: fit-content;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
}
html.popup-frame button:focus-visible, html.popup-frame input:focus-visible, html.popup-frame select:focus-visible, html.popup-frame label:has(input:focus-visible),
body.popup-body button:focus-visible,
body.popup-body input:focus-visible,
body.popup-body select:focus-visible,
body.popup-body label:has(input:focus-visible) {
  outline: 0.18rem solid rgba(168, 220, 77, 0.75);
  outline-offset: 0.18rem;
}

body.popup-body {
  overflow: hidden;
  background: transparent;
}
body.popup-body .piece-picker {
  grid-template-columns: repeat(3, 2rem);
  border: 0.1px solid gray;
  gap: 0.2rem;
  padding: 0.35rem;
}
body.popup-body .piece-picker button {
  width: 2.3rem;
  height: 2.3rem;
}

.popup-app {
  width: 30px;
  height: 30px;
  overflow: hidden;
  background: var(--section-bg);
  transition: width 180ms ease, height 180ms ease;
}
.popup-app .board-square.is-warning::after {
  background: var(--red);
  width: 16%;
}
.popup-app .popup-action-button {
  opacity: 0.4;
  cursor: default;
}
.popup-app .popup-action-button.is-valid {
  opacity: 1;
  cursor: pointer;
}
.popup-app .is-locked {
  opacity: 0.56;
}
.popup-app .is-locked::after {
  position: absolute;
  inset: 0;
  z-index: 5;
  content: "";
  cursor: default;
  background: transparent;
}
.popup-app .tool-section {
  box-shadow: none;
}
.popup-app .position-section {
  padding-bottom: 4px;
}
.popup-app .square-shell {
  width: 100%;
  aspect-ratio: 1;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 4px;
  background: #0c0e0b;
}
.popup-app .message {
  font-size: 0.82rem;
  height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: start;
}
.popup-app .message-section {
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: start;
}
.popup-app .board-en-passant {
  position: absolute;
  left: 50%;
  top: 0.6rem;
  transform: translateX(-50%);
}
.popup-app .turn-kicker {
  display: none;
  margin: 0;
  margin-left: 0.4rem;
  color: var(--green);
  font-size: 0.65rem;
  line-height: 1;
  transform: translateY(-100%);
}
.popup-app .turn-section {
  margin-top: 0;
  margin-bottom: 0;
}
.popup-app .segmented-control {
  min-height: 1.2rem;
  gap: 0;
  border-radius: var(--section-radius);
}
.popup-app .popup-loading-screen {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}
.popup-app .popup-error-message {
  display: none;
  padding: 0.75rem;
  font-size: 0.8rem;
  text-align: center;
  color: var(--red-85);
}
.popup-app .popup-error-message,
.popup-app .popup-app-content,
.popup-app .valid-pos-section,
.popup-app .invalid-pos-section {
  display: none;
}
.popup-app .popup-app-content {
  padding: 0;
}
.popup-app #quality-warning {
  background: var(--bg);
  margin: 2px;
  margin-top: 0px;
  width: calc(100% - 4px);
  padding: 0.5rem 0.7rem;
  padding-bottom: 0.34rem;
}
.popup-app.is-error, .popup-app.valid-pos, .popup-app.invalid-pos {
  width: 200px;
  height: auto;
}
.popup-app.is-error .popup-error-message {
  display: block;
}
.popup-app.is-error .popup-loading-screen {
  display: none;
}
.popup-app .popup-button {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
}
.popup-app.valid-pos .popup-loading-screen {
  display: none;
}
.popup-app.valid-pos .popup-app-content {
  display: block;
}
.popup-app.valid-pos .valid-pos-section {
  display: grid;
}
.popup-app.valid-pos .valid-pos-section button#edit-sidepanel-button {
  min-height: 30px;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 0;
  margin-top: 8px;
  color: var(--green);
  border: 0;
  border-radius: 6px;
}
.popup-app.valid-pos.has-turn .turn-kicker {
  display: block;
}
.popup-app.invalid-pos .popup-loading-screen {
  display: none;
}
.popup-app.invalid-pos .popup-app-content {
  display: block;
}
.popup-app.invalid-pos #turn-section,
.popup-app.invalid-pos .interaction-hint {
  display: none;
}
.popup-app.invalid-pos .invalid-pos-section {
  display: grid;
}
.popup-app.invalid-pos .invalid-pos-section button {
  width: 100%;
  min-height: 38px;
  background: var(--green);
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}
.popup-app .valid-pos-section,
.popup-app .invalid-pos-section {
  gap: 8px;
  padding: 14px;
}
.popup-app .turn-section {
  gap: 2px;
  padding: 0 10px;
}
.popup-app .popup-content {
  padding: 14px;
}
.popup-app .popup-app-header {
  margin: 1rem 0 0.4rem 0;
}
.popup-app .popup-app-brand {
  text-align: center;
}
.popup-app .popup-app-brand-main {
  font-size: 18px;
  font-weight: 600;
}
.popup-app .brand-domain {
  font-size: 11px;
  opacity: 0.6;
}
.popup-app .popup-message {
  margin-bottom: 4px;
  text-align: center;
}

/*# sourceMappingURL=styles.css.map */
