  :root {
    --silver:  #c0c0c0;
    --face:    #c0c0c0;
    --light:   #ffffff;
    --hi:      #dfdfdf;
    --shadow:  #808080;
    --dark:    #0a0a0a;
    --navy:    #000080;
    --blue:    #1084d0;
    --teal:    #008080;
    --ink:     #000000;
    --sel:     #000080;
    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; margin: 0; }
  body {
    background: var(--teal);
    color: var(--ink);
    font-family: Tahoma, "Segoe UI", Geneva, Verdana, sans-serif;
    font-size: 13px;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-font-smoothing: none;
  }
  ::selection { background: var(--sel); color: #fff; }

  .raised {
    background: var(--face);
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
  }
  .sunken {
    background: #fff;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi);
  }
  .pressed {
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--hi);
  }
  button.tap-press, .tbb.tap-press { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light) !important; transform: translateY(1px); }

  #desktop {
    position: fixed; inset: 0;
    background: var(--teal);
    display: flex; align-items: center; justify-content: center;
  }
  #win {
    display: flex; flex-direction: column;
    width: 100%; height: 100dvh; max-width: 520px; max-height: 900px;
    background: var(--face);
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
    padding: 3px;
  }
  @media (min-width: 540px) { #win { height: 88dvh; border: 1px solid #000; } }

  .titlebar {
    flex: none; position: relative;
    margin-top: var(--safe-top);
    background: linear-gradient(90deg, var(--navy), var(--blue));
    color: #fff;
    display: flex; align-items: center; gap: 6px;
    padding: 3px 4px 3px 5px;
    font-weight: 700; font-size: 13px;
    user-select: none;
  }
  .titlebar .figure { width: 16px; height: 16px; flex: none; }
  #tb-figure { width: 20px; height: 20px; }
  .tb-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 1px 1px 0 rgba(0,0,0,.4); }
  .tb-btns { display: flex; gap: 2px; }
  .tbb {
    width: 18px; height: 16px; padding: 0; margin: 0;
    background: var(--face); color: #000; border: 0; cursor: pointer;
    font: 700 11px Tahoma, sans-serif; line-height: 13px;
    display: grid; place-items: center;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
  }
  .tbb:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .tbb.deco { cursor: default; }
  #notify img { width: 14px; height: 14px; display: block; }

  .online {
    flex: none; display: flex; align-items: center; gap: 5px;
    padding: 3px 6px; font-size: 11.5px; color: #000;
    border-bottom: 1px solid var(--shadow);
  }
  .online .dot { width: 9px; height: 9px; border-radius: 50%; background: #16c60c;
    box-shadow: inset -1px -1px 0 #0a7a06; flex: none; }
  .online #status { color: #444; flex: none; }
  .online #room-name { font-weight: 700; color: var(--ink); white-space: nowrap; cursor: pointer;
    flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .online #buddies { color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .online .cog { flex: none; width: 22px; height: 18px; padding: 0; margin-left: 2px; cursor: pointer;
    background: var(--face); color: var(--ink); border: 0; font-size: 13px; line-height: 1; overflow: visible;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .online .cog:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .online .cog[hidden] { display: none; }
  .online .cog-ico { width: 12px; height: 12px; display: block; background-color: currentColor;
    -webkit-mask: url("cog.png") center / contain no-repeat; mask: url("cog.png") center / contain no-repeat; }

  #scroll-wrap {
    flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative;
    margin: 3px; padding: 2px;
    background: #fff;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi);
  }
  #scroll-down {
    position: absolute; left: 50%; bottom: 12px; z-index: 6;
    transform: translateX(-50%) translateY(6px); opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    width: 28px; height: 28px; padding: 0; cursor: pointer; border: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink); background: var(--face);
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi),
                1px 2px 5px rgba(0,0,0,.35);
  }
  #scroll-down svg { width: 18px; height: 18px; display: block; }
  #scroll-down.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
  #scroll-down.show:active { transform: translateX(-50%) translateY(1px);
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light), 1px 2px 5px rgba(0,0,0,.35); }
  #scroll {
    flex: 1; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 4px 6px;
    font-family: "Times New Roman", Times, Georgia, serif;
    font-size: 15px; line-height: 1.4; color: #000;
  }
  #scroll::-webkit-scrollbar { width: 16px; }
  #scroll::-webkit-scrollbar-track { background: #dfdfdf; }
  #scroll::-webkit-scrollbar-thumb { background: var(--face);
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }

  .line { margin: 1px 0; word-wrap: break-word; overflow-wrap: anywhere; position: relative; }
  .line .ts { color: #888; font-size: 11px; font-family: Tahoma, sans-serif; margin-right: 3px; }
  .line .sn { font-weight: 700; }
  .line .body { color: #000; white-space: pre-wrap; }
  .reply-quote { display: block; cursor: pointer; color: #777; font-size: 13px; line-height: 1.3;
    margin: 1px 0 1px 4px; padding-left: 6px; border-left: 2px solid var(--shadow);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .reply-quote:hover { color: var(--ink); }
  .reply-quote .rq-who { font-weight: 700; }
  .reply-quote .rq-arrow { display: inline-block; transform: scaleX(-1); margin-right: 4px; }
  html.dark .reply-quote { color: #9a9a9a; }
  .reply-btn { position: absolute; top: 0; right: 2px; display: none; cursor: pointer;
    width: 22px; height: 18px; align-items: center; justify-content: center; color: #000;
    font: 14px Tahoma, sans-serif;
    background: var(--face); box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  html.dark .reply-btn { color: var(--ink); }
  .line:hover .reply-btn { display: flex; }
  .line.flash { background: #fff7b0; }
  html.dark .line.flash { background: #4a4527; }
  .day {
    text-align: center; color: #888; font-style: italic; font-size: 12px;
    font-family: Tahoma, sans-serif; margin: 8px 0 4px;
  }
  .day.newmsg {
    display: flex; align-items: center; gap: 8px; margin: 10px 8px 6px;
    color: #d0492f; font-style: normal; font-weight: 700; letter-spacing: .03em;
  }
  .day.newmsg::before, .day.newmsg::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .45; }
  html.dark .day.newmsg { color: #ff7a68; }
  html.antiquity .day.newmsg { color: #b23a24; }
  html.antiquity.dark .day.newmsg { color: #f0a58c; }
  .media-line { margin: 3px 0 5px; }
  .media-line img, .media-line video {
    display: block; max-width: 240px; width: 100%; max-height: 280px;
    border: 2px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
    background: #000; object-fit: cover;
  }
  .media-line img.tarot-card {
    width: auto; max-width: none; height: 280px; max-height: 280px;
    border: 0; background: none; object-fit: contain; border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
  }
  .gallery { display: grid; gap: 3px; width: 240px; max-width: 240px; }
  .gallery[data-n="2"], .gallery[data-n="4"] { grid-template-columns: 1fr 1fr; }
  .gallery[data-n="3"] { grid-template-columns: 1fr 1fr 1fr; }
  .gallery-tile { position: relative; aspect-ratio: 1; overflow: hidden; background: #000;
    border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); }
  .gallery-tile img, .gallery-tile video {
    display: block; width: 100%; height: 100%; max-width: none; max-height: none;
    object-fit: cover; border: 0; }
  .gallery-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.5); color: #fff; font: 700 22px Tahoma, sans-serif; cursor: zoom-in; }
  .smiley { display: inline-block; height: 16px; width: auto; vertical-align: -3px; margin: 0 1px;
    image-rendering: pixelated; }
  #smiley-menu .em img.smiley { height: 24px; vertical-align: 0; }
  .msg-link { color: #0000ee; text-decoration: underline; overflow-wrap: anywhere; }
  html.dark .msg-link { color: #6ea8ff; }
  .mention { font-weight: 700; }
  .mention[data-user] { cursor: pointer; }
  .mention-all { color: #2f6fed; }
  html.dark .mention-all { color: #6ea8ff; }
  html.antiquity .mention-all { color: #9c5e1a; }
  html.antiquity.dark .mention-all { color: #e0a86a; }
  .ibx-last .smiley { height: 13px; vertical-align: -2px; margin: 0 1px; }
  .empty { color: #888; font-style: italic; text-align: center; padding: 24px 12px; font-family: Tahoma, sans-serif; }
  .pending { opacity: .55; }

  .toolbar {
    flex: none; position: relative;
    display: flex; align-items: center; gap: 3px;
    padding: 3px 4px; margin: 0 3px;
  }
  .t-btn {
    min-width: 26px; height: 24px; padding: 0 5px;
    background: var(--face); border: 0; cursor: pointer; color: #000;
    font: 14px "Times New Roman", serif; line-height: 22px;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
    display: grid; place-items: center;
  }
  .t-btn:active, .t-btn.on {
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--hi);
  }
  .t-btn.on { background: #d8d8d8; }
  .t-btn svg { width: 16px; height: 16px; }
  #color-sw { width: 14px; height: 11px; display: block; background: #000;
    border: 1px solid var(--shadow); }
  .spacer { flex: 1; }

  .pop {
    position: absolute; bottom: 30px; left: 4px; z-index: 20;
    background: var(--face); padding: 4px; display: none;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
  }
  .pop.show { display: block; }
  #b-game { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
  #b-game img { width: 22px; height: 22px; display: block; }
  .games-menu {
    position: absolute; bottom: 30px; right: 4px; z-index: 40; min-width: 110px;
    background: var(--face); padding: 2px; display: none;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
  }
  .games-menu.show { display: block; }
  .games-menu button { display: block; width: 100%; text-align: left; border: 0; background: none;
    color: var(--ink); font: 12px Tahoma, sans-serif; padding: 6px 14px; cursor: pointer; }
  .games-menu button:hover { background: var(--navy); color: #fff; }
  #palette { display: none; grid-template-columns: repeat(8, 16px); gap: 2px; }
  #palette.show { display: grid; }
  #palette .sw { width: 16px; height: 16px; cursor: pointer; border: 1px solid var(--shadow); }
  #smiley-menu { left: auto; right: 36px; }
  #smiley-menu.show { display: grid; grid-template-columns: repeat(4, 26px); gap: 3px; }
  #smiley-menu .em { width: 26px; height: 26px; cursor: pointer; display: grid; place-items: center; background: #fff;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light); }

  #preview { display: none; flex-direction: column; gap: 4px; margin: 0 6px; padding: 4px 6px;
    max-height: 132px; overflow-y: auto; background: #ffffcc; border: 1px solid var(--shadow); font-size: 11.5px; }
  #preview.show { display: flex; }
  .pv-row { display: flex; align-items: center; gap: 8px; }
  .pv-row img { width: 34px; height: 34px; flex: none; object-fit: cover; border: 1px solid var(--shadow); }
  .pv-row .pinfo { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pv-row .x { width: 20px; height: 18px; flex: none; cursor: pointer; background: var(--face); border: 0;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light); font-weight: 700; }
  #reply-chip { display: none; align-items: center; gap: 8px; margin: 0 6px; padding: 4px 6px;
    background: var(--face); border-left: 3px solid var(--navy); font-size: 11.5px; color: var(--ink);
    box-shadow: inset 1px 1px 0 var(--light), inset -1px -1px 0 var(--shadow); }
  #reply-chip.show { display: flex; }
  #reply-chip .rinfo { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #reply-chip .rinfo b { color: var(--navy); }
  html.dark #reply-chip .rinfo b { color: #8ab4ff; }
  #reply-chip .x { width: 20px; height: 18px; cursor: pointer; background: var(--face); border: 0; color: var(--ink);
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light); font-weight: 700; }

  .composer {
    flex: none; display: flex; gap: 5px; align-items: stretch; position: relative;
    padding: 4px; margin: 0 3px;
    padding-bottom: calc(4px + var(--safe-bottom));
  }
  .mention-menu {
    position: absolute; left: 4px; right: 4px; bottom: calc(100% + 2px); z-index: 20;
    max-height: 44vh; overflow-y: auto; display: none; background: var(--face);
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi), 1px 2px 7px rgba(0,0,0,.4);
  }
  .mention-menu.show { display: block; }
  .mention-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; cursor: pointer; }
  .mention-item.active { background: var(--navy); color: #fff; }
  .mention-item .mi-av { width: 24px; height: 24px; flex: none; object-fit: cover; border: 1px solid var(--shadow); }
  .mention-item .mi-all { display: grid; place-items: center; background: var(--face); color: var(--ink);
    font: 700 14px Tahoma, sans-serif; }
  .mention-item.active .mi-all { color: #fff; background: transparent; }
  .mention-item .mi-name { font: 700 13px Tahoma, sans-serif; color: var(--ink); }
  .mention-item.active .mi-name { color: #fff; }
  .mention-item .mi-sub { font: 11px Tahoma, sans-serif; color: #777; }
  .mention-item.active .mi-sub { color: #dfe4f5; }
  #win.readonly .toolbar, #win.readonly .composer, #win.readonly #preview, #win.readonly #reply-chip { display: none; }
  #win.readonly .reply-btn { display: none !important; }
  #text {
    flex: 1; resize: none; border: 0; outline: 0;
    background: #fff; color: #000;
    font-family: "Times New Roman", Times, serif; font-size: 15px; line-height: 1.35;
    padding: 5px 7px; min-height: 46px; max-height: 110px;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi);
  }
  .send-btn {
    flex: none; width: 74px; cursor: pointer; color: #000;
    background: var(--face); border: 0;
    font: 700 13px Tahoma, sans-serif;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
  }
  .send-btn:active:not(:disabled) {
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--hi);
  }
  .send-btn:disabled { color: var(--shadow); text-shadow: 1px 1px 0 var(--light); cursor: default; }
  .send-btn small { display: block; font-weight: 400; font-size: 9px; color: #333; }
  .send-btn:disabled small { color: var(--shadow); }

  .overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35);
    display: none; align-items: center; justify-content: center; padding: 16px; }
  .overlay.show { display: flex; }
  #photo-ov { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.6); padding: calc(var(--safe-top) + 8px) 8px calc(var(--safe-bottom) + 8px); }
  .dialog.photo-win { width: 100%; max-width: 760px; height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .photo-body { flex: 1; min-height: 0; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #000; touch-action: none; }
  .photo-body .photo-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 28px; height: 28px; min-width: 0; padding: 0; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink); background: var(--face); font: 700 16px/1 Tahoma, sans-serif;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi), 1px 2px 5px rgba(0,0,0,.35); }
  .photo-body .photo-nav:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light), 1px 2px 5px rgba(0,0,0,.35); }
  .online .navback span { display: inline-block; transform: translateY(-1px); }
  .photo-body .photo-nav span { display: inline-block; transform: translateY(-2px); }
  #photo-prev { left: 8px; } #photo-next { right: 8px; }
  .photo-body.nav-hidden .photo-nav { display: none !important; }
  .photo-menu { position: fixed; left: 50%; bottom: calc(36px + var(--safe-bottom)); transform: translateX(-50%); z-index: 300;
    display: none; flex-direction: column; gap: 3px; min-width: 180px; padding: 4px;
    background: var(--face);
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi), 2px 3px 9px rgba(0,0,0,.55); }
  .photo-menu.show { display: flex; }
  .photo-menu button { -webkit-appearance: none; appearance: none; width: 100%; padding: 6px 10px; cursor: pointer;
    color: var(--ink); background: var(--face); border: 0; font: 700 12px Tahoma, sans-serif;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .photo-menu button:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  html.antiquity .photo-menu button { border-radius: 4px; }
  .media-line img, .media-line video, .gallery-tile img, .gallery-tile video, .single-media video {
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .photo-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; will-change: transform; }
  #photo-img { max-width: 100%; max-height: 100%; transform-origin: center center; will-change: transform;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
  #photo-vid { max-width: 100%; max-height: 100%; display: none; }
  .single-media { position: relative; display: inline-block; line-height: 0; cursor: zoom-in; }
  .single-media video { display: block; max-width: 240px; width: 100%; max-height: 280px; object-fit: cover;
    border: 2px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); background: #000; }
  .play-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
  .play-badge::before { content: ""; width: 0; height: 0; border-style: solid;
    border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff; margin-left: 4px; }
  .gallery-tile .play-badge { width: 34px; height: 34px; }
  .gallery-tile .play-badge::before { border-width: 7px 0 7px 11px; margin-left: 3px; }
  .up-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 52px; height: 52px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(#fff calc(var(--p, 0) * 1%), rgba(255,255,255,.28) calc(var(--p, 0) * 1%));
    -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 5px), #000 calc(100% - 5px));
    mask: radial-gradient(farthest-side, #0000 calc(100% - 5px), #000 calc(100% - 5px));
    box-shadow: 0 1px 4px rgba(0,0,0,.5); }
  .up-cancel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 32px; height: 32px; border-radius: 50%; border: none; padding: 0; z-index: 2;
    -webkit-appearance: none; appearance: none; background: rgba(0,0,0,.6); color: #fff;
    font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.5); }
  .up-cancel:active { background: rgba(0,0,0,.78); }
  .up-cancel.tap-press { transform: translate(-50%, -50%); }
  .gallery-tile .up-ring { width: 40px; height: 40px; }
  .gallery-tile .up-cancel { width: 26px; height: 26px; font-size: 13px; }
  .dialog { width: 300px; max-width: 100%; background: var(--face); padding: 3px;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .dialog .titlebar { margin-top: 0; }
  .dialog .dbody { padding: 16px 14px 14px; }
  .dialog .figure-lg { width: 40px; height: 40px; display: block; margin: 0 auto 10px; }
  .dialog h2 { margin: 0 0 4px; text-align: center; font-size: 15px; }
  .dialog p { margin: 0 0 12px; font-size: 12px; line-height: 1.5; color: #000; }
  .dialog label { display: block; font-size: 11.5px; margin: 0 0 3px; font-weight: 700; }
  .dialog input[type=text], .dialog input[type=password], .dialog input[type=search] {
    width: 100%; border: 0; border-radius: 0; -webkit-appearance: none; appearance: none;
    background: #fff; color: #000; font: 14px Tahoma, sans-serif; padding: 5px 7px; margin-bottom: 14px;
    box-shadow: inset 1px 1px 0 var(--shadow), inset 2px 2px 0 var(--dark),
                inset -1px -1px 0 var(--shadow), inset -2px -2px 0 var(--hi); }
  .dialog input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
  .dialog .btn-row { display: flex; gap: 8px; justify-content: center; }
  .dialog .btn-col { display: flex; flex-direction: column; gap: 6px; }
  .dialog .btn-col button { width: 100%; }
  .dialog button { -webkit-appearance: none; appearance: none; min-width: 78px; padding: 5px 10px; cursor: pointer; color: var(--ink); background: var(--face);
    border: 0; font: 700 12px Tahoma, sans-serif;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .dialog button:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .dialog .err { color: #b00000; font-weight: 700; }
  .dialog code { background: #fff; padding: 0 3px; font-family: "Courier New", monospace; font-size: 11px; }
  .dialog ol { margin: 0 0 8px; padding-left: 18px; font-size: 12px; line-height: 1.6; }

  #paint-ov { z-index: 60; padding: 8px;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  .paint { width: 360px; display: flex; flex-direction: column; max-height: 94vh; overflow: auto; }
  .paint-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
    margin: 3px; padding: 5px; background: var(--face);
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi); }
  #pcanvas { max-width: 100%; max-height: 54vh; background: #fff; cursor: crosshair; touch-action: none; transform-origin: center center; will-change: transform; }
  .paint-bar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 4px 5px; }
  .paint .ptool, .paint .psize { flex: none; min-width: 0; width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--face); border: 0; cursor: pointer; padding: 0;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .paint .ptool.on, .paint .psize.on { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--hi); background: #d8d8d8; }
  .paint-sizes { display: contents; }
  .psize i { display: block; background: #000; border-radius: 50%; }
  .paint-palette-row { display: flex; gap: 6px; align-items: stretch; margin: 2px 5px; }
  .paint .pt-current { position: relative; flex: none; width: 40px; height: 40px; align-self: center; border: 1px solid #555; background: #000; cursor: pointer; }
  .paint .pt-current input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
  .paint-palette { flex: 1; display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
  .paint .pcolor { min-width: 0; width: 100%; aspect-ratio: 1; border: 1px solid #555; cursor: pointer; padding: 0; }
  .paint .pcolor.on { outline: 2px solid #fff; outline-offset: -3px; border-color: #000; }
  .paint .btn-row { padding: 6px; }

  .pe-bg-btn { display: block; width: 100%; padding: 6px 8px; margin-bottom: 14px; cursor: pointer; background: var(--face); border: 0; font: 700 12px Tahoma, sans-serif;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .pe-bg-btn:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  #pe-preview { margin-bottom: 10px; }
  .dlg-profile .dbody { padding: 3px; }
  .prof.has-bg { aspect-ratio: 4 / 3; background-size: cover; background-position: center; margin-bottom: 6px;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; }
  .prof.has-bg .prof-av { margin: 0; }
  .prof.has-bg .prof-info { background: none; box-shadow: none; width: 90%; padding: 0; }
  .prof.has-bg .prof-name,
  .prof.has-bg .prof-status { color: #fff;
    text-shadow: -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, -1px 1px 0 #000, 0 1px 0 #000, 1px 1px 0 #000; }
  .prof.has-bg .prof-name { margin-bottom: 2px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prof.has-bg .prof-status { min-height: 0; line-height: 1.3; word-wrap: break-word; overflow-wrap: anywhere; }
  .prof.has-bg .prof-status.empty { color: rgba(255, 255, 255, 0.75); }
  .ti { width: 16px; height: 16px; background: url("tools.png") no-repeat; background-size: 256px 16px; image-rendering: pixelated; }
  .ti-pencil { background-position: -96px 0; }
  .ti-eraser { background-position: -32px 0; }
  .ti-picker { background-position: -64px 0; }
  .ti-select { background-position: -16px 0; }
  .ti-bucket { background-position: -48px 0; }

  .tb-title { cursor: pointer; }
  .menu {
    position: absolute; top: 22px; left: 5px; z-index: 40; min-width: 120px;
    background: var(--face); padding: 2px; display: none;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi);
  }
  .menu.show { display: block; }
  .menu button {
    display: block; width: 100%; text-align: left; border: 0; background: none;
    color: var(--ink); font: 12px Tahoma, sans-serif; padding: 5px 10px; cursor: pointer;
  }
  .menu button:hover { background: var(--navy); color: #fff; }

  html.dark .online #buddies { color: #9a9a9a; }

  #inbox { display: none; flex: 1; flex-direction: column; overflow: hidden; }
  #win.inbox-mode #inbox { display: flex; }
  #win.inbox-mode .online,
  #win.inbox-mode #scroll-wrap,
  #win.inbox-mode .toolbar,
  #win.inbox-mode #preview,
  #win.inbox-mode #reply-chip,
  #win.inbox-mode .composer { display: none; }
  .ibx-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 6px;
    font-weight: 700; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--shadow); }
  .ibx-new { min-width: 0; width: 26px; height: 22px; padding: 0; flex: none; cursor: pointer;
    font: 700 15px Tahoma, sans-serif; line-height: 1; overflow: visible; display: inline-flex; align-items: center; justify-content: center;
    background: var(--face); color: var(--ink); border: 0;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .ibx-new:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .online .navback { width: 20px; height: 17px; padding: 0; margin-right: 2px; flex: none; cursor: pointer;
    background: var(--face); color: var(--ink); border: 0; font: 700 14px Tahoma, sans-serif; line-height: 1;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .online .navback:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .ibx-list { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
    margin: 3px; padding: 2px; background: #fff;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi); }
  .ibx-inner { flex: 1; min-height: 0; overflow-y: auto; }
  html.dark .ibx-list { background: #1e1e1e; }
  .ibx-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    border: 0; background: none; cursor: pointer; padding: 9px 10px; border-bottom: 1px solid #e2e2e2; }
  .ibx-row:hover { background: #e8eef7; }
  html.dark .ibx-row { border-bottom-color: #303030; }
  html.dark .ibx-row:hover { background: #2a2f3a; }
  .ibx-av { width: 42px; height: 42px; flex: none; object-fit: cover; background: #fff;
    border: 1px solid var(--shadow); }
  .ibx-text { flex: 1; min-width: 0; }
  .ibx-name { font: 700 13px Tahoma, sans-serif; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ibx-last { font-size: 12px; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
  html.dark .ibx-last { color: #9a9a9a; }
  .ibx-row.unread .ibx-name, .ibx-row.unread .ibx-last { font-weight: 700; }
  .ibx-row.unread .ibx-last { color: var(--ink); }
  .ibx-row.unread .ibx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }
  .ibx-time { font-size: 11px; color: #999; flex: none; align-self: flex-start; }
  #friends { display: none; flex: 1; flex-direction: column; overflow: hidden; }
  #win.friends-mode #friends { display: flex; }
  #win.friends-mode .online,
  #win.friends-mode #scroll-wrap,
  #win.friends-mode .toolbar,
  #win.friends-mode #preview,
  #win.friends-mode #reply-chip,
  #win.friends-mode .composer { display: none; }
  .frd-head { justify-content: space-between; gap: 8px; }
  #frd-search { flex: 1; min-width: 0; max-width: 240px; -webkit-appearance: none; appearance: none;
    font: 12px Tahoma, sans-serif; padding: 5px 7px; border: 0; outline: 0; background: #fff; color: #000;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi); }
  html.dark #frd-search { background: #1e1e1e; color: var(--ink); }
  #frd-search::placeholder { color: #888; }
  #frd-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
  .frd-row { cursor: pointer; }
  .frd-add { flex: none; min-width: 64px; font: 700 11px Tahoma, sans-serif; padding: 4px 10px; cursor: pointer; white-space: nowrap;
    color: var(--ink); background: var(--face); border: 0;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light),
                inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .frd-add.on, .frd-add:active {
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--shadow), inset -2px -2px 0 var(--hi); }
  .frd-empty { text-align: center; color: #888; padding: 24px; font-size: 12px; }

  .prof { text-align: center; }
  .prof-av {
    width: 72px; height: 72px; object-fit: cover; display: block; margin: 0 auto 8px;
    background: #fff; image-rendering: auto;
    border: 2px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  }
  .prof-name { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
  .prof-status { color: var(--ink); font-size: 12px; line-height: 1.5; min-height: 16px;
    word-wrap: break-word; overflow-wrap: anywhere; margin-bottom: 12px; }
  .prof-status.empty { color: #888; font-style: italic; }
  .prof .change { min-width: 0; padding: 4px 10px; margin-bottom: 12px; }

  .dlg-roomset .dbody { padding: 10px; }
  .roomset .rs-top { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; }
  .roomset .rs-icon { width: 56px; height: 56px; object-fit: cover; flex: none; background: #fff;
    box-shadow: inset 1px 1px 0 var(--shadow), inset 2px 2px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .roomset .change { min-width: 0; padding: 4px 10px; margin: 0; }
  .roomset .rs-name-label { text-align: center; }
  .roomset .rs-name-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 8px; }
  .roomset .rs-name-text { flex: 0 1 auto; min-width: 0; text-align: center; font: 700 14px Tahoma, sans-serif; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .roomset .rs-name-row input[type=text] { flex: 1; margin-bottom: 0; text-align: center; }
  .roomset .rs-name-edit { min-width: 0; width: 24px; height: 22px; padding: 0; flex: none; display: inline-flex; align-items: center; justify-content: center; }
  .roomset .rs-name-edit .ti { filter: grayscale(1); }
  .roomset .rs-empty { text-align: center; color: #888; font-size: 11.5px; padding: 6px; margin: 0; }
  .roomset label { display: block; font-size: 11px; color: #444; margin: 6px 0 3px; }
  .roomset input[type=search] { margin-bottom: 4px; }
  .roomset .rs-members { max-height: 150px; overflow-y: auto; margin-bottom: 6px; background: #fff;
    box-shadow: inset 1px 1px 0 var(--shadow), inset 2px 2px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .roomset .rs-mem { display: flex; align-items: center; gap: 7px; padding: 4px 6px; }
  .roomset .rs-mem-av { width: 24px; height: 24px; object-fit: cover; flex: none; border: 1px solid #888; }
  .roomset .rs-mem-name { flex: 1; font-size: 12.5px; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .roomset .rs-mem.on .rs-mem-name { font-weight: 700; }
  .roomset .rs-mem.on .rs-mem-av { border-color: #16c60c; }
  .roomset .rs-mem-x { min-width: 0; width: 20px; height: 20px; padding: 0; font: 700 11px Tahoma, sans-serif; flex: none; }
  .roomset .rs-results { margin-bottom: 4px; }
  .roomset .rs-res { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; margin-bottom: 2px;
    padding: 4px 6px; justify-content: flex-start; text-align: left; font: 12.5px Tahoma, sans-serif; }
  .roomset .rs-res .rs-mem-av { width: 22px; height: 22px; }
  .roomset .rs-leave { color: #a00000; }

  .ngroup .rs-members { min-height: 32px; }
  .dmset .ds-name { font: 700 14px Tahoma, sans-serif; color: #000; }
  .dmset .ds-add { min-width: 0; width: 100%; margin: 10px 0 2px; }
  .dmset .ds-hint { font-size: 10.5px; color: #888; margin: 2px 0 0; }

  #wordle-ov { z-index: 100; background: rgba(0, 0, 0, 0.6);
    padding: calc(var(--safe-top) + 8px) 8px calc(var(--safe-bottom) + 8px); }
  .dialog.wordle-win { width: 100%; max-width: 380px; height: 100%; max-height: 640px; min-height: 0; display: flex; flex-direction: column; }
  .wordle-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .wd-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
  .wd-foot { flex: none; position: relative; padding: 6px 8px 8px; }
  .wd-foot::before { content: ""; position: absolute; top: 0; left: 8px; right: 8px; height: 1px; background: var(--shadow); }
  .wd-by { text-align: center; font-size: 11.5px; color: #555; margin-bottom: 6px; }
  .wd-board { display: flex; flex-direction: column; gap: 5px; align-items: center; }
  .wd-row { display: flex; gap: 5px; }
  .wd-tile { width: 42px; height: 42px; display: grid; place-items: center; background: #fff; color: #000;
    font: 700 22px Tahoma, sans-serif;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light), inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi); }
  .wd-tile.filled { box-shadow: inset 1px 1px 0 var(--light), inset -1px -1px 0 var(--shadow), inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--dark); }
  .wd-tile.correct { background: #6aaa64; color: #fff; box-shadow: inset 2px 2px 0 #88c281, inset -2px -2px 0 #4e8a48; }
  .wd-tile.present { background: #c9b458; color: #fff; box-shadow: inset 2px 2px 0 #ddcb78, inset -2px -2px 0 #a8923c; }
  .wd-tile.absent  { background: #787c7e; color: #fff; box-shadow: inset 2px 2px 0 #969a9c, inset -2px -2px 0 #5a5e60; }
  .wd-row.shake { animation: wd-shake 0.4s; }
  @keyframes wd-shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-5px)} 40%,80%{transform:translateX(5px)} }
  .wd-msg { text-align: center; min-height: 16px; font: 700 12.5px Tahoma, sans-serif; color: var(--ink); margin: 0 0 6px; }
  .wd-keyboard { display: flex; flex-direction: column; gap: 5px; }
  .wd-kb-row { display: flex; gap: 3px; width: 100%; }
  .wordle-win .wd-key { flex: 1 1 0; min-width: 0; max-width: 40px; height: 42px; padding: 0; -webkit-appearance: none; appearance: none;
    font: 700 13px Tahoma, sans-serif; color: #000; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; background: var(--face); border: 0;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .wd-key.wide { flex: 1.6 1 0; max-width: none; font-size: 9.5px; }
  .wd-key:active, .wd-key.pressed { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); transform: translateY(1px); }
  .wd-key.correct { background: #6aaa64; color: #fff; }
  .wd-key.present { background: #c9b458; color: #fff; }
  .wd-key.absent  { background: #787c7e; color: #fff; }
  .wd-key:disabled { cursor: default; }
  .wd-score { border-top: 1px solid var(--shadow); margin-top: 8px; padding-top: 6px; }
  .wd-sc-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; padding: 2px 2px; }
  .wd-sc-rank { flex: none; margin-right: 5px; color: #888; font-weight: 700; }
  .wd-sc-rank:empty { display: none; }
  .wd-sc-name { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wd-sc-stat { flex: none; margin-left: 8px; font-weight: 700; color: #666; }
  .wd-sc-stat.solved { color: #2e7d32; }
  .wd-sc-stat.failed { color: #b00000; }
  .wd-sc-stat.host { color: #888; font-weight: 400; font-style: italic; }
  .wd-sc-stat.playing { color: #888; font-weight: 400; }

  .wd-card { display: inline-block; vertical-align: top; min-width: 150px; max-width: 240px; margin: 2px 0;
    background: var(--face); padding: 6px 8px; font-family: Tahoma, sans-serif;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .wd-card-head { display: block; text-align: center; font-weight: 700; font-size: 13px; color: #000; margin-bottom: 4px; }
  .wd-card-score { display: block; margin-bottom: 5px; }
  .wd-card-score .wd-sc-row { font-size: 11.5px; padding: 1px 0; }
  .wd-card-score .wd-sc-stat { font-size: 11px; }
  .wd-card-score .wd-sc-none { color: #888; font-style: italic; }
  .wd-play { width: 100%; min-width: 0; padding: 3px; font: 700 12px Tahoma, sans-serif; color: #000; cursor: pointer;
    background: var(--face); border: 0;
    box-shadow: inset -1px -1px 0 var(--dark), inset 1px 1px 0 var(--light), inset -2px -2px 0 var(--shadow), inset 2px 2px 0 var(--hi); }
  .wd-play:active { box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--light); }
  .newwd .nw-hint { margin: 0 0 8px; font-size: 12px; color: #444; line-height: 1.4; text-align: center; }
  #nw-word { text-transform: uppercase; letter-spacing: 5px; font-weight: 700; text-align: center; margin-bottom: 6px; }
  .pcolors { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 0 0 12px; }
  .pc-sw {
    width: 22px; height: 22px; padding: 0; cursor: pointer;
    border: 2px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  }
  .pc-sw.sel { outline: 2px solid var(--navy); outline-offset: 1px; }

  .settings label { margin-bottom: 4px; }
  .set-select {
    width: 100%; margin: 0 0 16px; padding: 4px 6px; border: 0; background: #fff; color: #000;
    font: 13px Tahoma, sans-serif;
    box-shadow: inset 1px 1px 0 var(--shadow), inset 2px 2px 0 var(--dark), inset -1px -1px 0 var(--light);
  }
  html.dark .set-select { background: #1e1e1e; color: var(--ink); }
  .cb { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0 0 12px;
    font-size: 12.5px; color: var(--ink); font-weight: 700; }
  .cb .box, .tshare-tick {
    width: 13px; height: 13px; flex: none; position: relative; background: #fff;
    box-shadow: inset 1px 1px 0 var(--shadow), inset -1px -1px 0 var(--light),
                inset 2px 2px 0 var(--dark), inset -2px -2px 0 var(--hi);
  }
  .cb.on .box::after, .tshare-row.on .tshare-tick::after {
    content: ""; position: absolute; left: 4px; top: 0; width: 3px; height: 7px;
    border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .cb.disabled { opacity: .5; cursor: default; }
  .rs-notify { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--shadow); justify-content: center; }

  html.dark {
    --face:   #3c3c3c;
    --light:  #5e5e5e;
    --hi:     #4a4a4a;
    --shadow: #1a1a1a;
    --dark:   #000000;
    --teal:   #161616;
    --ink:    #e6e6e6;
  }
  html.dark body { color: var(--ink); }
  html.dark #scroll-wrap { background: #1e1e1e; }
  html.dark #scroll { color: var(--ink); }
  html.dark #scroll::-webkit-scrollbar-track { background: #2a2a2a; }
  html.dark .line .body { color: var(--ink); }
  html.dark .day, html.dark .empty { color: #9a9a9a; }
  html.dark .online { color: var(--ink); }
  html.dark .online #status { color: #aaa; }
  html.dark .online #buddies { color: #8ab4ff; }
  html.dark #text { background: #1e1e1e; color: var(--ink); }
  html.dark #preview { background: #3a3a22; color: var(--ink); }
  html.dark #smiley-menu .em { background: #1e1e1e; }
  html.dark .dialog p, html.dark .dialog h2, html.dark .dialog label { color: var(--ink); }
  html.dark .dialog input[type=text], html.dark .dialog input[type=password],
  html.dark .dialog input[type=search],
  html.dark .dialog code { background: #1e1e1e; color: var(--ink); }
  html.dark #color-sw { background: var(--ink); }

  html.antiquity {
    --face:   #dacfb0;
    --light:  #927a4e;
    --hi:     #927a4e;
    --shadow: #927a4e;
    --dark:   #927a4e;
    --navy:   #241c10;
    --blue:   #5c4827;
    --teal:   #1a150c;
    --ink:    #241c10;
    --sel:    #fccf8a;
  }
  html.antiquity .online, html.antiquity .toolbar, html.antiquity .composer { background: #d6caa8; }
  html.antiquity .t-btn, html.antiquity .tbb, html.antiquity .online .cog, html.antiquity .ibx-new, html.antiquity .online .navback { border-radius: 2px; }
  html.antiquity .send-btn, html.antiquity .dialog button, html.antiquity #text,
  html.antiquity #frd-search, html.antiquity .set-select, html.antiquity #set-sound,
  html.antiquity .dialog input[type=text], html.antiquity .dialog input[type=password],
  html.antiquity .dialog input[type=search] { border-radius: 4px; }
  html.antiquity .dialog { border-radius: 5px; }
  html.antiquity #desktop {
    background: url("antiquity-bg-180.jpg") center / cover no-repeat;
  }
  html.antiquity #win { background: var(--face); }
  html.antiquity #inbox, html.antiquity #friends {
    background:
      linear-gradient(rgba(247,240,222,.3), rgba(242,234,213,.36)),
      url("antiquity-bg-180.jpg") center / cover no-repeat;
  }
  html.antiquity .ibx-head > span { color: #241c10; }
  html.antiquity .send-btn:disabled { text-shadow: none; }
  html.antiquity .titlebar { color: #fccf8a; border-bottom: 3px double #7a5e2a;
    background:
      linear-gradient(90deg, rgba(20,15,8,.92), rgba(20,15,8,.4) 26%, rgba(20,15,8,0) 44%),
      url("titlebar-vine.png") no-repeat center / 100% 100%,
      linear-gradient(90deg, var(--navy), var(--blue)); }
  html.antiquity ::selection { color: #241c10; }
  html.antiquity .online { color: #2a2114; }
  html.antiquity .online #status { color: #6b5836; }
  html.antiquity .online #buddies { color: #7a5f30; }
  html.antiquity .online #room-name { color: #2a2114; }
  html.antiquity #scroll-wrap {
    background:
      linear-gradient(rgba(247,240,222,.3), rgba(242,234,213,.36)),
      url("antiquity-bg-180.jpg") center / cover no-repeat;
  }
  html.antiquity .line {
    margin: 5px 3px; padding: 4px 10px 6px;
    background:
      linear-gradient(rgba(120,90,44,.13), rgba(120,90,44,0) 7px),
      linear-gradient(to top, rgba(120,90,44,.13), rgba(120,90,44,0) 7px),
      url("parchment.jpg") center / cover #efe6d0;
    border: 1px solid #c9b48b; border-radius: 5px;
    box-shadow: 1px 2px 3px rgba(14,9,3,.42);
    background-clip: padding-box;
  }
  html.antiquity.bubbles .line { margin: 5px auto 5px 3px; width: fit-content; max-width: 82%; }
  html.antiquity.bubbles .line.mine { margin-left: auto; margin-right: 3px; }
  html.antiquity.bubbles .media-line.mine { text-align: right; }
  html.antiquity.bubbles .media-line.mine img, html.antiquity.bubbles .media-line.mine video { margin-left: auto; }
  html.antiquity.bubbles .media-line.mine .gallery { margin-left: auto; }
  html.antiquity.bubbles .media-line.mine .wd-card { text-align: left; }
  html.antiquity .line .ts { color: #9a8862; }
  html.antiquity .line.flash { background: #f6e7ad; }
  html.antiquity .reply-btn {
    top: 0; bottom: 0; right: 4px; margin: auto 0; border-radius: 2px; }
  html.antiquity .empty {
    margin: 18px; padding: 152px 16px 18px;
    background: url("antiquity-sun.svg") center 16px / 124px no-repeat, url("parchment.jpg") center / cover #efe6d0;
    border: 1px solid #c9b48b; border-radius: 6px; color: #7a5e2a;
    box-shadow: 1px 2px 3px rgba(14,9,3,.42);
  }
  html.antiquity .sunken,
  html.antiquity #text,
  html.antiquity #frd-search,
  html.antiquity .ibx-list,
  html.antiquity .ibx-av,
  html.antiquity .prof-av,
  html.antiquity .roomset .rs-icon,
  html.antiquity .roomset .rs-members,
  html.antiquity #smiley-menu .em,
  html.antiquity .set-select,
  html.antiquity .dialog input[type=text],
  html.antiquity .dialog input[type=password],
  html.antiquity .dialog input[type=search],
  html.antiquity .dialog code { background: #efe6d0; }
  html.antiquity #scroll::-webkit-scrollbar-track { background: #b9a87f; }
  html.antiquity #preview { background: #e4d8bc; }
  html.antiquity .ibx-row { border-bottom-color: #b6a079; }
  html.antiquity .ibx-row:hover { background: #e6dbc0; }
  html.antiquity .t-btn.on { background: #ddc488; }
  html.antiquity .msg-link,
  html.antiquity #reply-chip .rinfo b { color: #9c5e1a; }

  html.antiquity.dark {
    --face:   #2b2823;
    --light:  #9a8458;
    --hi:     #9a8458;
    --shadow: #9a8458;
    --dark:   #9a8458;
    --navy:   #161310;
    --blue:   #3a2e1c;
    --teal:   #0e0c0a;
    --ink:    #e8dcc4;
    --sel:    #f5d089;
  }
  html.antiquity.dark body, html.antiquity.dark #scroll { color: var(--ink); }
  html.antiquity.dark #desktop { background: #16222e; }
  html.antiquity.dark #scroll-wrap,
  html.antiquity.dark #inbox, html.antiquity.dark #friends {
    background:
      linear-gradient(rgba(16,12,8,.2), rgba(16,12,8,.32)),
      url("celestial.jpg") center / cover no-repeat; }
  html.antiquity.dark .online, html.antiquity.dark .toolbar, html.antiquity.dark .composer { background: #242019; }
  html.antiquity.dark ::selection { color: #1a140c; }
  html.antiquity.dark .online { color: #ddd2b8; }
  html.antiquity.dark .online #status { color: #a4936f; }
  html.antiquity.dark .online #buddies { color: #c1a96f; }
  html.antiquity.dark .online #room-name { color: #efe2c6; }
  html.antiquity.dark .ibx-head > span { color: #efe2c6; }
  html.antiquity.dark .t-btn, html.antiquity.dark .tbb, html.antiquity.dark .send-btn { color: var(--ink); }
  html.antiquity.dark .send-btn small { color: #a4936f; }
  html.antiquity.dark .t-btn svg { stroke: var(--ink); }
  html.antiquity.dark .t-btn svg circle { fill: var(--ink); }
  html.antiquity.dark #b-game img { filter: invert(1) sepia(.4); }
  html.antiquity.dark #color-sw { background: var(--ink); }
  html.antiquity.dark .reply-btn { color: var(--ink); }
  html.antiquity.dark .line {
    background:
      linear-gradient(rgba(0,0,0,.26), rgba(0,0,0,0) 7px),
      linear-gradient(to top, rgba(0,0,0,.26), rgba(0,0,0,0) 7px),
      url("parchment-dark.jpg") center / cover #322d24;
    border-color: #8a7350; box-shadow: 1px 2px 4px rgba(0,0,0,.5); }
  html.antiquity.dark .line .body { color: var(--ink); }
  html.antiquity.dark .line .ts { color: #9a8a68; }
  html.antiquity.dark .line.flash { background: #4a3f28; }
  html.antiquity.dark .reply-quote { color: #ab9d7e; }
  html.antiquity.dark .day, html.antiquity.dark .empty, html.antiquity.dark .ibx-last { color: #a89a78; }
  html.antiquity.dark .empty {
    background: url("antiquity-sun.svg") center 16px / 124px no-repeat,
      url("parchment-dark.jpg") center / cover #322d24;
    border-color: #8a7350; }
  html.antiquity.dark .sunken, html.antiquity.dark #text,
  html.antiquity.dark #frd-search, html.antiquity.dark .ibx-list, html.antiquity.dark .ibx-av,
  html.antiquity.dark .prof-av, html.antiquity.dark .roomset .rs-icon, html.antiquity.dark .roomset .rs-members,
  html.antiquity.dark #smiley-menu .em, html.antiquity.dark .set-select, html.antiquity.dark #set-sound,
  html.antiquity.dark .dialog input[type=text], html.antiquity.dark .dialog input[type=password],
  html.antiquity.dark .dialog input[type=search], html.antiquity.dark .dialog code { background: #201d16; color: var(--ink); }
  html.antiquity.dark .dialog p, html.antiquity.dark .dialog h2, html.antiquity.dark .dialog label,
  html.antiquity.dark .roomset .rs-name-text, html.antiquity.dark .roomset .rs-mem-name, html.antiquity.dark .dmset .ds-name { color: var(--ink); }
  html.antiquity.dark #scroll::-webkit-scrollbar-track { background: #221e16; }
  html.antiquity.dark #preview { background: #2a251c; }
  html.antiquity.dark .ibx-row { border-bottom-color: #3a3326; }
  html.antiquity.dark .ibx-row:hover { background: #2e2820; }
  html.antiquity.dark .t-btn.on { background: #4a3f28; }
  html.antiquity.dark .msg-link, html.antiquity.dark #reply-chip .rinfo b { color: #d8b46a; }
  html.antiquity.dark .wd-card-head { color: #fccf8a; }
  html.antiquity.dark .wd-by { color: #a99b79; }
  html.antiquity.dark .wd-play, html.antiquity.dark .wordle-win .wd-key { color: var(--ink); }
  html.antiquity.dark .wd-sc-stat { color: #cabd97; }
  html.antiquity.dark .wd-sc-rank, html.antiquity.dark .wd-sc-stat.host,
  html.antiquity.dark .wd-sc-stat.playing, html.antiquity.dark .wd-card-score .wd-sc-none { color: #a99b79; }
  html.antiquity.dark .wd-sc-stat.solved { color: #82c785; }
  html.antiquity.dark .wd-sc-stat.failed { color: #e88a8a; }
  html.antiquity.dark .newwd .nw-hint { color: #a99b79; }

  /* --- Daily tarot reveal --- */
  #tarot-ov, #tarot-view-ov { z-index: 120; background: rgba(0,0,0,.72); }
  .tarot-reveal { display: flex; flex-direction: column; align-items: center; gap: 18px; }
  .tarot-view-card { width: min(72vw, 300px); aspect-ratio: 300 / 527; cursor: pointer;
    border-radius: 12px; overflow: hidden; box-shadow: 0 12px 44px rgba(0,0,0,.6); }
  .tarot-view-card img { width: 100%; height: 100%; object-fit: contain; display: block;
    user-select: none; -webkit-user-drag: none; }
  .tarot-flip { width: min(72vw, 300px); aspect-ratio: 300 / 527; position: relative;
    transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.7,.2,1); cursor: pointer; }
  .tarot-flip.flipped { transform: rotateY(180deg); }
  .tarot-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border-radius: 12px; overflow: hidden; box-shadow: 0 12px 44px rgba(0,0,0,.6); }
  .tarot-face img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
  .tarot-front { transform: rotateY(180deg); }
  .tarot-hint { color: #e8dcc0; font-size: 15px; letter-spacing: .04em; margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,.85); }
  .tarot-share { -webkit-appearance: none; appearance: none; cursor: pointer;
    font: 600 14px Tahoma, sans-serif; padding: 8px 18px; color: #1a140a;
    background: #e8dcc0; border: 0; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
  .tarot-share:active { transform: translateY(1px); box-shadow: 0 1px 3px rgba(0,0,0,.5); }
  .tarot-share[hidden] { display: none; }
  .tarot-view-btn { display: block; margin: 0 0 12px; }
  .tshare-lead { font-size: 12px; color: #555; margin: 0 0 8px; line-height: 1.35; }
  html.dark .tshare-lead { color: #b7b7b7; }
  .roomset .tshare-frame { overflow: hidden; max-height: none; padding: 2px; }
  .roomset .tshare-scroll { max-height: 46vh; overflow-y: auto; }
  .tshare-row { cursor: pointer; border-radius: 3px; }
  .tshare-row:hover { background: rgba(0,0,0,.06); }
  html.dark .tshare-row:hover { background: rgba(255,255,255,.08); }
  .tshare-tick { margin-left: 2px; }
