/* Shared foundations */
* { box-sizing: border-box; scrollbar-color: #85857b transparent; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; line-height: normal; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #174bd4; outline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #85857b; border-radius: 999px; }

body.remilio-page {
  color: #32322e;
  background: #b3b19e;
  font-synthesis: none;
  height: 100dvh;
  overflow: hidden;
}
body.remilio-page .page-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  overscroll-behavior-y: contain;
}
body.remilio-page button, body.remilio-page input, body.remilio-page select {
  color: inherit;
}
body.remilio-page button {
  cursor: pointer;
}
body.remilio-page button:focus-visible, body.remilio-page input:focus-visible, body.remilio-page select:focus-visible {
  outline: 2px solid #8b4e64;
  outline-offset: 3px;
}
body.remilio-page .window {
  max-width: 1160px;
  margin: auto;
  padding: 12px;
  background: #e7e7e5;
  border: 2px solid #565652;
  box-shadow:
    inset 2px 2px #fff,
    inset -2px -2px #a2a29d,
    3px 4px 0 #929180;
}
body.remilio-page .titlebar {
  padding: 0 4px 11px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #67675f;
}
body.remilio-page .name {
  display: block;
  width: 100%;
  height: 51px;
  background: #fafafa;
  border: 2px solid #73736d;
  box-shadow: inset 2px 2px 4px #a0a09a;
  padding: 9px 14px;
  font-size: 23px;
  font-style: italic;
}
body.remilio-page .workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  margin-top: 14px;
}
body.remilio-page .preview-frame {
  padding: 18px;
  min-width: 0;
}
body.remilio-page .card {
  height: min(73vh, 750px);
  min-height: 480px;
  position: relative;
  overflow: hidden;
  border: 9px solid #d3d1c4;
  box-shadow:
    0 0 0 2px #f2f0e5,
    0 0 0 4px #b4b2a7,
    inset 0 0 0 2px #fff8;
  background-color: #8d9d91;
  background-image:
    radial-gradient(#e8f4df55 1.5px, transparent 1.5px),
    linear-gradient(145deg, #7b9088, #b3c3a6);
  background-size:
    12px 12px,
    100% 100%;
}
body.remilio-page .card:before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid #fff8;
  pointer-events: none;
  z-index: 1;
}
body.remilio-page .card canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  touch-action: none;
}
body.remilio-page .caption {
  position: absolute;
  bottom: 26px;
  left: 26px;
  right: 26px;
  z-index: 3;
  display: flex;
  color: #fffbed;
  pointer-events: none;
}
body.remilio-page .caption strong {
  font-size: 21px;
  font-weight: normal;
  font-style: italic;
  max-width: 75%;
  overflow-wrap: anywhere;
}
body.remilio-page .hint {
  margin: 15px 0 0;
  text-align: center;
  color: #73736a;
  font-size: 11px;
}
body.remilio-page .panel {
  border: 2px solid #686863;
  box-shadow:
    inset 2px 2px 3px #aaa,
    inset -2px -2px 3px #fff;
  align-self: start;
  background: #e4e4e2;
}
body.remilio-page .panel h1 {
  margin: 0;
  padding: 16px 14px;
  font-size: 17px;
  font-weight: normal;
  color: #5a5a55;
  border-bottom: 4px solid #777770;
}
body.remilio-page .field {
  padding: 14px;
  border-bottom: 1px solid #777770;
  box-shadow: 0 1px #fff8;
}
body.remilio-page .field label, body.remilio-page .field .label {
  display: block;
  font-size: 14px;
  font-style: italic;
  margin-bottom: 8px;
}
body.remilio-page .field select {
  width: 100%;
  height: 31px;
  background: #fafafa;
  border: 1px solid #85857b;
  font-style: italic;
  padding: 3px 6px;
}
body.remilio-page .color-row {
  display: flex;
  gap: 8px;
}
body.remilio-page .color-row input[type="color"] {
  width: 48px;
  height: 33px;
  padding: 2px;
  background: #eee;
  border: 1px solid #777;
}
body.remilio-page .hex {
  width: 100%;
  min-width: 0;
  height: 33px;
  border: 1px solid #888;
  padding: 5px 8px;
  background: #f7f7f4;
  font: 13px monospace;
  text-transform: uppercase;
}
body.remilio-page .swatches {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}
body.remilio-page .swatches button {
  width: 25px;
  height: 25px;
  background: var(--color);
  border: 1px solid #646459;
  box-shadow: inset 1px 1px #ffffff80;
}
body.remilio-page .swatches button[aria-pressed="true"] {
  outline: 2px solid #666653;
  outline-offset: 2px;
}
body.remilio-page .actions {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
body.remilio-page .bevel {
  background: #f4f4f1;
  border: 2px solid #64645f;
  box-shadow:
    inset 2px 2px #fff,
    inset -2px -2px #c5c5bd;
  padding: 8px 6px;
  font-size: 13px;
  font-style: italic;
  font-weight: bold;
}
body.remilio-page .bevel:active {
  box-shadow: inset 2px 2px #aaa;
  transform: translateY(1px);
}
body.remilio-page .bevel:disabled {
  opacity: 0.5;
  cursor: wait;
}
body.remilio-page .reset {
  grid-column: 1/-1;
}
body.remilio-page .status {
  font-size: 11px;
  line-height: 1.5;
  padding: 0 14px 13px;
  color: #6c6c61;
  min-height: 34px;
}
body.remilio-page .file {
  display: none;
}
body.remilio-page .load {
  display: block;
  margin-top: 8px;
  background: none;
  border: 0;
  text-decoration: underline;
  font-size: 11px;
  padding: 0;
  cursor: pointer;
}
body.remilio-page .error {
  color: #862d34;
}
body.remilio-page .loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: #fff;
  font-size: 13px;
  z-index: 4;
  pointer-events: none;
}
body.remilio-page .loading[hidden] {
  display: none;
}
@media (max-width: 760px) {
  body.remilio-page .page-scroll {
    padding: 10px;
  }
  body.remilio-page .workspace {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  body.remilio-page .card {
    height: 62vh;
    min-height: 390px;
  }
  body.remilio-page .preview-frame {
    padding: 12px;
  }
  body.remilio-page .panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  body.remilio-page .panel h1, body.remilio-page .actions, body.remilio-page .status {
    grid-column: 1/-1;
  }
  body.remilio-page .field {
    min-width: 0;
  }
  body.remilio-page .titlebar {
    font-size: 9px;
  }
}
body.remilio-page .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
body.remilio-page .button-row .bevel[aria-pressed="true"] {
  background: #d8d5c7;
  box-shadow:
    inset 2px 2px #aaa,
    inset -2px -2px #fff;
  outline: 1px solid #666653;
  outline-offset: 1px;
}
body.remilio-page .mouth-option {
  flex: 1 0 42%;
  display: grid;
  justify-items: center;
  gap: 3px;
}
body.remilio-page .mouth-option img {
  width: 75px;
  height: 30px;
  object-fit: contain;
}
