/* 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; }

/* Site chrome */
.site-page { line-height: 1.5; min-height: 100dvh; color: #000; background: #e4e7ed; }
.site-header { position: sticky; top: 0; z-index: 10; }
.ticker { height: 40px; overflow: hidden; border: 2px solid #4ade80; border-radius: 4px; background: #181818; }
.ticker-track { display: flex; width: max-content; animation: scroll-left 30s linear infinite; }
.ticker-copy { display: flex; flex-shrink: 0; }
.ticker-copy span { padding: .32rem 1.3rem; font: 1.15rem/1.5 'Courier New', monospace; letter-spacing: .12em; white-space: nowrap; color: #39ff14; text-shadow: 0 0 4px #39ff14, 0 0 12px #39ff14; }
@keyframes scroll-left { to { transform: translateX(-50%); } }
.site-nav { display: flex; align-items: center; gap: 16px; height: 32px; padding: 0 8px; background: #155dfc; color: white; font: 500 16px/1 'Courier New', monospace; text-transform: uppercase; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: #fde047; }
.site-logo { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); }
.site-logo img { display: block; width: auto; height: 96px; object-fit: contain; transition: transform .6s, filter .6s; }
.site-logo:hover img { transform: scale(1.15); filter: brightness(1.1); }
.site-logo:active img { transform: scale(.95); }

/* Home navigation */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; gap: 16px; max-width: 672px; margin: 0 auto 24px; padding: 88px 8px 0; perspective: 1000px; }
.nav-card { --card-color: #bedbff; position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 100%; height: 180px; padding: 16px; overflow: hidden; border: 2px solid #6b728080; border-radius: 24px; background: linear-gradient(var(--card-color), white); box-shadow: 0 4px 4px #0000001a; font-size: 20px; font-weight: 600; text-decoration: none; transform-style: preserve-3d; transition: transform .18s ease-out, box-shadow .18s; }
.nav-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--shine-x, 50%) var(--shine-y, 50%), #ffffffcc, #ffffff4d 30%, transparent 60%); opacity: 0; pointer-events: none; transition: opacity .3s; }
.nav-card:hover::before { opacity: 1; }
.nav-card > * { position: relative; }
.nav-card small { font-size: 14px; line-height: 1.5; opacity: .8; }
.card-slate { --card-color: #cbd5e1; }
.card-green { --card-color: #b9f8cf; }
.card-red { --card-color: #ffc9c9; }
.nav-card:hover { box-shadow: 0 5px 12px #0003; }
.nav-card:active { transform: scale(.95); }

/* About and Milady */
.about-content { max-width: 320px; margin: 0 auto 24px; padding: 88px 8px 0; }
.about-content p, .milady-content p { margin: 0 0 24px; }
.tagline { font-style: italic; text-align: center; }
.milady-content { width: min(100% - 24px, 420px); margin: 0 auto 24px; padding-top: 88px; }
.milady-hero { display: block; width: min(300px, 100%); height: auto; margin: auto; }
.milady-content h1 { margin: 24px 0 16px; text-align: center; font-size: 24px; }
.milady-content hr { border: 0; border-top: 2px solid #d1d5db; margin: 16px 0; }
.feature-image { display: block; width: 100%; height: auto; border-radius: 8px; margin-bottom: 16px; }
.milady-viewer { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0 0 24px; }
.toy-frame, .model-picker, .model-actions a { background: #fde047; border-radius: 24px; box-shadow: 0 4px 20px #0003, inset 0 -2px 6px 3px #ffffff99; }
.toy-frame { width: 100%; padding: 16px; overflow: hidden; }
.toy-frame iframe { display: block; width: 100%; height: 380px; border: 0; border-radius: 8px; box-shadow: 0 0 2px #000; }
.model-picker { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 16px; }
.model-picker button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #facc15; box-shadow: 0 3px 0 #0003, inset 0 1px 2px #ffffffb3; font-size: 18px; font-weight: bold; cursor: pointer; }
.model-picker button:disabled { opacity: .5; cursor: default; }
.model-picker input { width: 80px; padding: 4px 8px; border: 0; border-radius: 12px; background: #fef9c3; box-shadow: inset 0 2px 4px #00000026; text-align: center; font-weight: bold; letter-spacing: .1em; appearance: textfield; }
.model-picker input::-webkit-inner-spin-button, .model-picker input::-webkit-outer-spin-button { appearance: none; }
.model-actions { display: flex; gap: 8px; }
.model-actions a { padding: 8px 12px; border-radius: 16px; font-size: 12px; font-weight: bold; text-decoration: none; }
.model-picker button:active, .model-actions a:active { transform: translateY(2px); }

@media (max-width: 680px) {
  .home-grid { grid-template-columns: minmax(0, 320px); }
  .site-logo img { height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .site-page *, .site-page *::before { transition: none; }
}

/* Milady Studio */

body.studio-page .pockit-milady-studio {
  --shell1: #cfb2ec; --shell2: #a985d1; --shell-edge: #7e5ba6; --shell-hi: #eadcf9;
  --ink: #41295e;
  --tray1: #98a394; --tray2: #79857a; --tray-edge: #59645c;
  --grn1: #b5c99b; --grn2: #94ab77; --grn-ink: #3f4d28;
  --tan1: #d2bd94; --tan2: #b39c73; --tan-ink: #584a2c;
  --lcd1: #9fae92; --lcd2: #a9b79b; --lcd-ink: #2f3d26;
  position: fixed; inset: 0; z-index: 50; margin: 0; padding: 0; overflow: hidden; background: transparent; overscroll-behavior: none; }

body.studio-page .pockit-milady-studio > canvas { position: absolute; inset: 0; touch-action: none; }
body.studio-page .pockit-milady-studio.green { background: #00ff00; }
body.studio-page .pockit-milady-studio.magenta { background: #ff00ff; }
body.studio-page .pockit-milady-studio.white { background: #ffffff; }
body.studio-page .pockit-milady-studio.black { background: #000000; }
body.studio-page .pockit-milady-studio.bgimg { background-size: cover; background-position: center; background-repeat: no-repeat; }

body.studio-page .pockit-milady-studio.checker {
  background: conic-gradient(#d9d9d9 25%, #f1f1f1 0 50%, #d9d9d9 0 75%, #f1f1f1 0) 0 0 / 18px 18px;
}
body.studio-page #ui, body.studio-page #bigbar, body.studio-page #peek, body.studio-page button, body.studio-page input, body.studio-page select {
  font-family: 'Courier New', monospace;
  touch-action: manipulation;
}

body.studio-page #ui {
  position: fixed; z-index: 10; width: 232px;
  top: calc(10px + var(--vvt, 0px) + env(safe-area-inset-top, 0px));
  left: calc(10px + var(--vvl, 0px) + env(safe-area-inset-left, 0px));
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 20px);
  overflow-y: auto;
  padding: 36px 12px 10px;
  background: linear-gradient(180deg, var(--shell1), var(--shell2));
  border: 2px solid var(--shell-edge); border-radius: 16px;
  box-shadow: inset 0 2px 0 var(--shell-hi), inset 0 -3px 0 rgba(0,0,0,.18), 0 4px 14px rgba(0,0,0,.35);
  color: var(--ink); font-size: 10px; line-height: 2.1; user-select: none;
}
body.studio-page #ui::before {
  content: 'MILADY TRACKER';
  position: absolute; top: 7px; left: 10px; right: 10px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; letter-spacing: 2px; color: var(--ink);
  background:
    radial-gradient(circle, rgba(65,41,94,.16) 1.2px, transparent 1.7px) 0 0 / 7px 7px repeat,
    linear-gradient(180deg, #bb9adf, #a583cd);
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.28), inset 0 -1px 0 rgba(255,255,255,.25);
}

body.studio-page #ui #uiClose {
  position: absolute; top: 8px; right: 12px; margin: 0; z-index: 1;
  width: 20px; height: 20px; padding: 0; border-radius: 7px;
  font-size: 9px; line-height: 1;
}
body.studio-page #ui label { display: block; cursor: pointer; }
body.studio-page #ui .fxrow label { display: inline; margin-right: 6px; }
body.studio-page #ui button { margin: 4px 4px 0 0; }
body.studio-page #ui input[type=checkbox] { accent-color: var(--shell-edge); }
body.studio-page #ui input[type=text], body.studio-page #ui select {
  background: #eee6f7; border: 1px solid var(--shell-edge); border-radius: 6px;
  padding: 1px 5px; font-size: 10px; color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.2);
}
body.studio-page #status {
  background: linear-gradient(180deg, var(--lcd1), var(--lcd2));
  color: var(--lcd-ink); border-radius: 6px; padding: 4px 7px; margin-bottom: 6px;
  box-shadow: inset 0 2px 3px rgba(0,0,0,.35), inset 0 -1px 0 rgba(255,255,255,.35);
  font-size: 9px; line-height: 1.6; min-height: 14px;
}
body.studio-page button {
  cursor: pointer; color: var(--grn-ink);
  background: linear-gradient(180deg, var(--grn1), var(--grn2));
  border: 2px solid rgba(0,0,0,.28); border-radius: 9px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.18), 0 2px 3px rgba(0,0,0,.25);
  padding: 2px 10px; font-size: 9px; text-transform: uppercase; letter-spacing: .5px;
}
body.studio-page button:hover { filter: brightness(1.06); }
body.studio-page button:active { box-shadow: inset 0 2px 4px rgba(0,0,0,.35); transform: translateY(1px); }
body.studio-page #rezero, body.studio-page #bigbar [data-act=rezero] { background: linear-gradient(180deg, var(--tan1), var(--tan2)); color: var(--tan-ink); }
body.studio-page #bigbar {
  position: fixed; bottom: calc(14px + var(--vvb, 0px)); left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center;
  width: max-content;
  max-width: calc(100vw - 16px);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  gap: 10px; z-index: 20; padding: 12px 14px;
  background: linear-gradient(180deg, var(--tray1), var(--tray2));
  border: 2px solid var(--tray-edge); border-radius: 18px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.22), 0 6px 16px rgba(0,0,0,.4);
  transition: opacity .5s;
}
body.studio-page #bigbar button {
  font-size: 13px; padding: 14px 14px; border-radius: 12px; min-width: 92px;
}
body.studio-page #bigbar button.on {
  background: linear-gradient(180deg, #cde6a8, #a8c87e);
  box-shadow: inset 0 3px 5px rgba(0,0,0,.3);
}
body.studio-page #bigbar [data-act=milady] { background: linear-gradient(180deg, var(--shell1), var(--shell2)); color: var(--ink); }
body.studio-page #bigbar [data-act=fx], body.studio-page #dlgRandom { background: linear-gradient(180deg, #eab0cd, #d18cb0); color: #5e2846; }
body.studio-page #bigbar [data-act=fx].on { background: linear-gradient(180deg, #f7c7de, #de9bc0); box-shadow: inset 0 3px 5px rgba(0,0,0,.3); }
body.studio-page #bigbar [data-act=hide], body.studio-page #dlgCancel { background: linear-gradient(180deg, #b9bec4, #969ca3); color: #363b41; }

body.studio-page #bigbar [data-act=record], body.studio-page #recordBtn { background: linear-gradient(180deg, #d89090, #b96a6a); color: #4a2020; }
body.studio-page button.rec { animation: recPulse 1.2s ease-in-out infinite; box-shadow: inset 0 3px 5px rgba(0,0,0,.3), 0 0 8px rgba(255,60,60,.7); }
@keyframes recPulse { 50% { filter: brightness(1.2); } }
body.studio-page #bigbar.faded { opacity: 0; pointer-events: none; }

body.studio-page #peek {
  position: fixed; z-index: 20;
  bottom: calc(10px + var(--vvb, 0px) + env(safe-area-inset-bottom, 0px));
  right: calc(10px + var(--vvr, 0px) + env(safe-area-inset-right, 0px));
  width: 46px; height: 46px; border-radius: 50%;
  font-size: 28px; padding: 0; line-height: 1;
  background: transparent; border: none; box-shadow: none;
  color: rgba(255,255,255,.92); text-shadow: 0 1px 4px rgba(0,0,0,.55);
  opacity: 0; transition: opacity .3s;
}
body.studio-page #peek:hover { opacity: 1; }
body.studio-page #peek:active { box-shadow: none; }

body.studio-page #miladyDlg {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 10, 30, .45);
}
body.studio-page .dlgbox {
  width: 280px; padding: 14px 16px 16px; text-align: center;
  background: linear-gradient(180deg, var(--shell1), var(--shell2));
  border: 2px solid var(--shell-edge); border-radius: 16px;
  box-shadow: inset 0 2px 0 var(--shell-hi), inset 0 -3px 0 rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.5);
  color: var(--ink);
}
body.studio-page .dlgtitle { font-size: 11px; letter-spacing: 2px; margin-bottom: 8px; }
body.studio-page .dlglabel { font-size: 8px; margin-bottom: 8px; opacity: .8; }
body.studio-page #dlgId {
  width: 120px; text-align: center; font-size: 14px; padding: 4px 6px;
  background: linear-gradient(180deg, var(--lcd1), var(--lcd2));
  color: var(--lcd-ink); border: 1px solid var(--shell-edge); border-radius: 6px;
  box-shadow: inset 0 2px 3px rgba(0,0,0,.35);
}
body.studio-page .linksrow { margin-top: 4px; font-size: 8px; letter-spacing: 1px; }
body.studio-page .linksrow a { color: var(--ink); }

body.studio-page .kbtoggle {
  background: transparent; border: none; box-shadow: none;
  padding: 2px 4px; font-size: 12px; line-height: 1;
  color: var(--ink); opacity: .45;
}
body.studio-page .kbtoggle:hover { opacity: .8; filter: none; }
body.studio-page .kbtoggle:active { box-shadow: none; transform: none; }
body.studio-page .dlgrow { margin-top: 12px; display: flex; gap: 8px; justify-content: center; }
body.studio-page .dlgrow button { font-size: 10px; padding: 8px 10px; }

body.studio-page #scan {
  position: fixed; inset: 0; z-index: 5; display: none; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.20) 0 2px, transparent 2px 4px);
}
body.studio-page canvas.rainbow { animation: hueSpin 6s linear infinite; }
@keyframes hueSpin { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

@media (max-width: 760px) {
  body.studio-page #bigbar { gap: 5px; padding: 7px; bottom: calc(8px + var(--vvb, 0px) + env(safe-area-inset-bottom, 0px)); }
  body.studio-page #bigbar button { min-width: 0; flex: 1 0 auto; font-size: 9px; padding: 9px 6px; }
  body.studio-page #miladyDlg .dlgbox { max-width: calc(100vw - 32px); }
}

@media (orientation: landscape) and (max-height: 500px) {
  body.studio-page #bigbar {
    left: calc(8px + var(--vvl, 0px) + env(safe-area-inset-left, 0px));
    top: 50%; bottom: auto; transform: translateY(-50%);
    flex-direction: column; flex-wrap: nowrap; justify-content: flex-start;
    width: auto; max-width: none;
    max-height: calc(100dvh - 16px);
    overflow-y: auto; gap: 5px; padding: 7px;
  }
  body.studio-page #bigbar button { min-width: 0; flex: 0 0 auto; font-size: 9px; padding: 8px 7px; }
  body.studio-page #ui { left: auto; right: calc(10px + var(--vvr, 0px)); }
  body.studio-page #miladyDlg .dlgbox { max-width: calc(100vw - 32px); }
}

body.studio-page #ui.hidden,
body.studio-page #bigbar.hidden,
body.studio-page #peek.hidden,
body.studio-page #miladyDlg.hidden { display: none; }

body.studio-page .studio-token-input { width: 56px; }
body.studio-page .studio-help { opacity: .7; }

/* remilio-page */

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;
}

/* os-page */

body.os-page {
    --dock-bg: rgba(20, 20, 20, 0.3);
    --menu-bg: rgba(20, 20, 20, 0.3);
    --window-bg: rgba(30, 30, 32, 0.85);
    --text-color: #ffffff;
    --accent: #007aff;
    --system-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 0; width: 100vw; height: 100vh; overflow: hidden;
    font-family: var(--system-font); color: var(--text-color);

    background: linear-gradient(200deg, #a729f5, #5823d6, #092775, #1d6f9c);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    cursor: default;
}
body.os-page * { user-select: none; }

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.os-page #boot-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 99999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 1s ease-out;
}
body.os-page .apple-logo { color: white; font-size: 80px; margin-bottom: 40px; }
body.os-page .loading-bar {
    width: 200px; height: 6px; background: #333; border-radius: 3px; overflow: hidden;
}
body.os-page .loading-progress {
    height: 100%; background: #fff; width: 0%; border-radius: 3px;
    transition: width 3s ease-in-out;
}

body.os-page #desktop { width: 100%; height: 100%; position: relative; }

body.os-page #menubar {
    position: absolute; top: 0; width: 100%; height: 30px;
    background: var(--menu-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; font-size: 13px; font-weight: 500; z-index: 5000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
body.os-page .menu-left, body.os-page .menu-right { display: flex; gap: 15px; align-items: center; }
body.os-page .menu-item:hover { background: rgba(255,255,255,0.1); border-radius: 4px; padding: 2px 8px; margin: -2px -8px;}
body.os-page .apple-icon { font-size: 16px; }
body.os-page #active-app-name { font-weight: 700; }

body.os-page #dock-container {
    position: absolute; bottom: 10px; width: 100%;
    display: flex; justify-content: center; z-index: 6000;
}
body.os-page #dock {
    background: var(--dock-bg);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.1);
    height: 70px; padding: 5px 10px; border-radius: 20px;
    display: flex; align-items: flex-end; gap: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}
body.os-page .dock-item {
    width: 55px; height: 55px; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1); position: relative;
    cursor: pointer;
}

body.os-page .dock-icon-svg { width: 100%; height: 100%; border-radius: 14px; }

body.os-page .dock-item:hover { transform: scale(1.2) translateY(-10px); margin: 0 5px; }
body.os-page .dock-dot {
    width: 5px; height: 5px; background: rgba(255,255,255,0.4); border-radius: 50%;
    position: absolute; bottom: -8px; display: none;
}
body.os-page .dock-item.active .dock-dot { display: block; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
body.os-page .bouncing { animation: bounce 0.6s ease infinite; }

body.os-page .window {
    position: absolute; background: var(--window-bg);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    display: flex; flex-direction: column; overflow: hidden;
    min-width: 300px; min-height: 200px;
    transition: transform 0.15s, opacity 0.15s, box-shadow 0.2s;
    transform-origin: center;
}

body.os-page .window.opening { animation: winOpen 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes winOpen { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; }}

body.os-page .window.inactive {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.05);
}
body.os-page .window.inactive .traffic-lights span { background-color: #555 !important; color: #555 !important;}

body.os-page .window-header {
    height: 30px; background: rgba(255,255,255,0.05);
    display: flex; align-items: center; position: relative; cursor: grab;
}
body.os-page .window-header:active { cursor: grabbing; }

body.os-page .traffic-lights {
    display: flex; gap: 8px; margin-left: 12px; z-index: 2;
}
body.os-page .t-btn {
    width: 12px; height: 12px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 8px; color: transparent; transition: 0.1s; cursor: default;
}
body.os-page .traffic-lights:hover .t-btn { color: rgba(0,0,0,0.6); }
body.os-page .close-btn { background: #ff5f56; }
body.os-page .min-btn { background: #ffbd2e; }
body.os-page .max-btn { background: #27c93f; }

body.os-page .window-title {
    position: absolute; width: 100%; text-align: center; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8); pointer-events: none;
}
body.os-page .window-content {
    flex: 1; overflow: auto; position: relative;
    user-select: text;
}

body.os-page .ui-resizable-se { bottom: 0; right: 0; width: 15px; height: 15px; background: none; }

body.os-page #context-menu {
    position: absolute; background: rgba(40,40,40,0.9); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 5px 0;
    width: 180px; display: none; z-index: 99999;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
body.os-page .ctx-item { padding: 6px 15px; font-size: 13px; cursor: default; display: flex; justify-content: space-between;}
body.os-page .ctx-item:hover { background: var(--accent); color: white; }
body.os-page .ctx-hr { border-top: 1px solid rgba(255,255,255,0.1); margin: 4px 0; }

body.os-page .finder-layout { display: flex; height: 100%; background: #1e1e1e; color: #ddd; }
body.os-page .finder-sidebar { width: 140px; background: rgba(50,50,50,0.3); padding: 10px; backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 5px;}
body.os-page .sidebar-item { padding: 5px 10px; border-radius: 5px; font-size: 12px; display: flex; align-items: center; gap: 8px; cursor: pointer;}
body.os-page .sidebar-item:hover { background: rgba(255,255,255,0.1); }
body.os-page .sidebar-item i { color: var(--accent); width: 15px; text-align: center;}
body.os-page .finder-main { flex: 1; padding: 10px; overflow-y: auto; }
body.os-page .finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 15px; }
body.os-page .file-item { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; }
body.os-page .file-icon { font-size: 40px; color: #5dade2; margin-bottom: 5px; }
body.os-page .file-icon.text { color: #ddd; }
body.os-page .file-icon.img { color: #58d68d; }
body.os-page .file-name { font-size: 12px; word-break: break-all; padding: 2px 4px; border-radius: 3px;}
body.os-page .file-item:hover .file-name { background: var(--accent); }

body.os-page .terminal-app { background: #101010; color: #33ff00; font-family: 'Courier New', monospace; padding: 10px; height: 100%; overflow-y: auto; font-size: 13px;}
body.os-page .term-line { margin-bottom: 2px; line-height: 1.4; }
body.os-page .term-input-line { display: flex; }
body.os-page .term-prompt { color: #00bfff; margin-right: 8px; }
body.os-page #term-input { background: transparent; border: none; color: #33ff00; font-family: inherit; font-size: inherit; flex: 1; outline: none; }

body.os-page .textedit-app { background: #2d2d2d; height: 100%; display: flex; flex-direction: column; }
body.os-page .text-toolbar { padding: 5px; background: #3a3a3a; border-bottom: 1px solid #444; display: flex; gap: 5px; }
body.os-page .text-tool { padding: 4px 8px; background: #444; border-radius: 4px; cursor: pointer; font-size: 12px;}
body.os-page #text-area { flex: 1; background: #1e1e1e; color: #eee; border: none; padding: 15px; font-family: var(--system-font); font-size: 14px; outline: none; resize: none; line-height: 1.5; }

body.os-page .paint-app { display: flex; flex-direction: column; height: 100%; background: #fff; }
body.os-page .paint-toolbar { padding: 8px; background: #f0f0f0; border-bottom: 1px solid #ccc; display: flex; gap: 10px; align-items: center; color: #333;}
body.os-page #paint-canvas { background: white; cursor: crosshair; touch-action: none; flex: 1; display: block;}

body.os-page .calc-app { background: #333; height: 100%; display: flex; flex-direction: column; padding: 10px; }
body.os-page #calc-display { background: transparent; color: white; font-size: 36px; text-align: right; border: none; width: 100%; margin-bottom: 10px; outline: none; font-weight: 300;}
body.os-page .calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; flex: 1; }
body.os-page .calc-btn { border: none; border-radius: 50%; font-size: 18px; cursor: pointer; transition: filter 0.1s; color: white;}
body.os-page .calc-btn:active { filter: brightness(1.2); }
body.os-page .c-num { background: #555; }
body.os-page .c-op { background: #ff9f0a; font-size: 22px; padding-top: 3px;}
body.os-page .c-top { background: #a5a5a5; color: black; }
body.os-page .c-zero { grid-column: span 2; border-radius: 30px; text-align: left; padding-left: 25px;}

body.os-page .safari-app { display: flex; flex-direction: column; height: 100%; background: #fff; }
body.os-page .safari-bar { padding: 8px; background: #f0f0f0; border-bottom: 1px solid #ccc; display: flex; gap: 10px; align-items: center; }
body.os-page .url-bar { flex: 1; background: #ddd; border: none; padding: 5px 10px; border-radius: 8px; text-align: center; font-size: 12px; color: #333; outline: none;}
body.os-page .safari-frame { flex: 1; border: none; width: 100%; background: white; }

body.os-page .studio-app { background: #000; height: 100%; display: flex; flex-direction: column; }
body.os-page .video-stage { flex: 1; display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative;}
body.os-page #main-video { max-width: 100%; max-height: 100%; }
body.os-page .studio-controls { height: 80px; background: #1a1a1a; padding: 10px; display: flex; flex-direction: column; gap: 5px; }
body.os-page .filters-row { display: flex; gap: 10px; justify-content: center; }
body.os-page .filter-btn { padding: 4px 10px; background: #333; border-radius: 4px; font-size: 11px; cursor: pointer; border: 1px solid #444;}
body.os-page .filter-btn.active { background: var(--accent); border-color: var(--accent); }
body.os-page .playback-row { display: flex; justify-content: center; align-items: center; gap: 15px; color: #ddd;}

body.os-page .settings-app { padding: 20px; color: white; display: flex; flex-direction: column; gap: 20px; align-items: center;}
body.os-page .wall-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
body.os-page .wall-thumb { height: 80px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: 0.2s;}
body.os-page .wall-thumb:hover { transform: scale(1.02); }
body.os-page .wall-thumb.selected { border-color: var(--accent); }

body.os-page .icon-finder { background: linear-gradient(180deg, #e3e3e3 0%, #c7c7c7 100%); position: relative; overflow: hidden; }
body.os-page .icon-finder::after { content: ':)'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(90deg); font-size: 30px; font-weight: bold; color: #2a62b3; font-family: monospace;}

body.os-page .icon-safari { background: white; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%23fff'/%3E%3Ccircle cx='50' cy='50' r='45' fill='%231facfd'/%3E%3Cpath d='M50 5 L50 95 M5 50 L95 50' stroke='rgba(255,255,255,0.3)' stroke-width='1'/%3E%3Cpolygon points='50,10 60,45 90,50 55,60 50,90 40,55 10,50 45,40' fill='white'/%3E%3Cpolygon points='50,10 55,45 50,50 45,45' fill='%23ea4335'/%3E%3C/svg%3E"); background-size: cover;}

body.os-page .icon-terminal { background: #222; position: relative; }
body.os-page .icon-terminal::after { content: '>_'; color: #fff; position: absolute; top: 10px; left: 10px; font-family: monospace; font-size: 24px; font-weight: bold;}

body.os-page .icon-text { background: linear-gradient(180deg, #fdfdfd 0%, #dcdcdc 100%); position: relative; }
body.os-page .icon-text::after { content: ''; position: absolute; top: 15px; left: 10px; right: 10px; height: 2px; background: #999; box-shadow: 0 5px 0 #999, 0 10px 0 #999, 0 15px 0 #999; }

body.os-page .icon-paint { background: linear-gradient(45deg, #ff3b30, #ff9500, #ffcc00, #4cd964, #5ac8fa, #007aff, #5856d6, #ff2d55); }
body.os-page .icon-paint::after { content: '\f1fc'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: white; font-size: 30px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-shadow: 0 2px 5px rgba(0,0,0,0.3);}

body.os-page .icon-calc { background: #333; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; gap: 2px;}
body.os-page .icon-calc div { background: #ff9f0a; border-radius: 4px; }
body.os-page .icon-calc div:nth-child(1), body.os-page .icon-calc div:nth-child(2) { background: #555; }

body.os-page .icon-studio { background: linear-gradient(135deg, #3a1c71, #d76d77, #ffaf7b); position: relative; }
body.os-page .icon-studio::after { content: '\f008'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: white; font-size: 28px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

body.os-page .icon-settings { background: linear-gradient(180deg, #8e8e93 0%, #636366 100%); position: relative; }
body.os-page .icon-settings::after { content: '\f013'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: #ddd; font-size: 35px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

body.os-page .icon-trash { background: linear-gradient(180deg, #f2f2f7 0%, #d1d1d6 100%); position: relative; }
body.os-page .icon-trash::after { content: '\f1f8'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: #777; font-size: 30px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* os-page */
@keyframes hue { 0% {filter: hue-rotate(0deg);} 100% {filter: hue-rotate(360deg);} }
