/* OGS account information follows the reference's light typography, dotted rows and floating glass. */
@font-face {
  font-family: Jost; font-style: normal; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/jost-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: Jost; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/jost-latin-400-normal.woff2") format("woff2");
}
:root {
  --font: Jost, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg: #fafafa; --ogs-text: #1e1e1e; --text-2: rgba(30,30,30,.76); --text-3: rgba(30,30,30,.63);
  --fill: rgba(30,30,30,.045); --fill-2: rgba(30,30,30,.08); --line: rgba(30,30,30,.22); --sep: rgba(30,30,30,.14);
  --dotline: rgba(30,30,30,.3); --on-ink: #fafafa;
  --tab-glass: rgba(252,252,252,.38); --tab-glass-mid: rgba(246,246,246,.22); --tab-glass-end: rgba(244,244,244,.28);
  --tab-border: rgba(255,255,255,.58); --tab-highlight: rgba(255,255,255,.8);
  --ink-lift: -8px 11px 18px -8px rgba(0,0,0,.3), -2px 3px 5px -2px rgba(0,0,0,.1);
  --glass-float: -26px 36px 70px -38px rgba(0,0,0,.3), -5px 9px 20px -12px rgba(0,0,0,.12);
}
:root:not([data-theme="light"]) {
  --bg: #000; --ogs-text: #e8e8e8; --text-2: rgba(232,232,232,.8); --text-3: rgba(232,232,232,.66);
  --fill: rgba(232,232,232,.05); --fill-2: rgba(232,232,232,.1); --line: rgba(232,232,232,.24); --sep: rgba(232,232,232,.14);
  --dotline: rgba(232,232,232,.28); --on-ink: #000;
  --tab-glass: rgba(46,46,46,.4); --tab-glass-mid: rgba(24,24,24,.32); --tab-glass-end: rgba(16,16,16,.42);
  --tab-border: rgba(255,255,255,.1); --tab-highlight: rgba(255,255,255,.12);
  --ink-lift: 0 0 28px rgba(255,255,255,.42), 0 0 10px rgba(255,255,255,.38);
  --glass-float: 0 30px 70px -36px rgba(0,0,0,.85), 0 10px 24px -14px rgba(0,0,0,.55);
}
:root.embed, :root.standalone {
  --accent: var(--ogs-text); --accent-2: var(--ogs-text); --link: var(--ogs-text); --accent-soft: var(--fill-2);
  --danger: var(--ogs-text); --ok: var(--ogs-text); --warn: var(--text-2);
  --focus: 0 0 0 2px var(--line);
}
:root.embed {
  --bg: transparent; --bg-2: transparent; --surface: transparent; --surface-2: transparent;
  --sidebar: transparent; --card: transparent; --group-bg: transparent;
}
body { font: 400 15px/1.53 var(--font); letter-spacing: .015em; }

/* ---- Embedded mode: transparent full-screen iframe ---- */
html.embed, html.embed body { background: transparent !important; overflow: hidden; height: 100%; }
/* An iframe whose color-scheme differs from the one its embedder gives the <iframe> element is painted
   opaque. Until the SDK says which one the app's page uses (widget.js sets it inline), assume "normal". */
html.embed { color-scheme: normal !important; }
html.embed body { margin: 0; }
.backdrop, .frame, .avatar-btn, .ball { display: none; }

.shell { outline: none; }
.win { background: transparent; overflow: hidden; color: var(--ogs-text); }

/* The SDK blurs the host; this clear hit area only dismisses the information layer. */
html.embed .backdrop { display: block; position: fixed; inset: 0; z-index: 0; background: transparent; opacity: 0; transition: opacity .4s cubic-bezier(.4,0,.2,1); }
html.embed .backdrop.on { opacity: 1; transition-duration: .5s; }
/* An older cached SDK cannot blur the host. Keep its account page readable until upgraded. */
html.embed:not(.host-backdrop):not(.windowed) .backdrop { background: #111; }
html.embed:not(.host-backdrop):not(.windowed)[data-theme="light"] .backdrop { background: #fafafa; }
/* A window of its own: the page behind it dims, in step with the window (widget.js sets the duration). */
html.embed.windowed .backdrop { background: rgb(0 0 0 / .4); }
html.embed .frame {
  display: block; position: fixed; left: 0; top: 0; width: 40px; height: 40px; z-index: 1; border-radius: 20px; pointer-events: none;
  background: transparent; box-shadow: none;
}
html.embed .frame.open { box-shadow: none; }
/* The SDK paints the closed glass on the host page, where it can refract that page's real backdrop. */
html.embed .frame.rest { background: transparent; box-shadow: none; }
html.embed .frame[hidden], html.embed .avatar-btn[hidden] { display: none; }
html.embed .shell { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
html.embed .win {
  position: absolute; left: var(--x, 0); top: var(--y, 0); width: var(--w, 880px); height: var(--h, 620px);
  border: 0; border-radius: 0; box-shadow: none; pointer-events: auto; contain: layout paint;
}
/* On a computer: a window of its own in the middle of the page, on paper like an app's window (widget.js, finalRect).
   It unfolds from the avatar: it scales from its own top left, which the motion's translate starts on the avatar. */
html.embed .win.windowed {
  border-radius: var(--r, 22px); transform-origin: 0 0; background: #000;
  box-shadow: 0 30px 80px -28px rgb(0 0 0 / .85), 0 12px 28px -16px rgb(0 0 0 / .5), 0 0 0 .5px rgb(255 255 255 / .16);
}
html.embed[data-theme="light"] .win.windowed {
  background: #fafafa;
  box-shadow: 0 30px 80px -28px rgb(0 0 0 / .34), 0 12px 28px -16px rgb(0 0 0 / .16), 0 0 0 .5px rgb(0 0 0 / .1);
}
html.embed .avatar-btn {
  display: block; position: fixed; left: 0; top: 0; width: 32px; height: 32px; z-index: 3; border-radius: 50%;
  cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none;
}
/* The host draws the closed avatar; the same hit target shows its own content when docked. */
/* Closed, the button is the whole disc the page shows (the 40px frame: the 32px initial and its 4px ring), not the
   initial alone: on the ring the pointer was an arrow and a click did nothing, so the cursor flickered at its edge. */
html.embed .avatar-btn.rest::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
html.embed .avatar-btn:focus-visible { box-shadow: var(--focus); }
/* Open: the avatar sits in the window, in its place next to the name. On a computer it flies there from its corner
   (and back), above the window, as the window grows out of its ring (widget.js, fly). */
html.embed .avatar-btn.docked { position: relative; width: 100%; height: 100%; cursor: inherit; }
html.embed .avatar-btn.flying { z-index: 4; pointer-events: none; }
.avatar-btn .avatar-initial, .avatar-btn .avatar-photo {
  display: none; position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  object-fit: cover; border-radius: inherit; pointer-events: none; background: none;
}
.avatar-btn:is(.docked, .flying) .avatar-initial { display: grid; place-items: center; color: inherit; font-size: 24px; font-weight: 300; }
.avatar-btn:is(.docked, .flying) .avatar-photo { display: block; }
.me-slot { display: block; width: 40px; height: 40px; flex: none; border-radius: 50%; }

/* The ball (bottom right, like the avatar top right): a white ring at 75% of its width, glowing a little, on the
   glass the SDK draws under this iframe. Open, it grows sideways (to the left) into a capsule of the same height
   with an input. --ball-r / --ball-b: its distance from the right and bottom (safe area + 12px); --ball-w: open. */
html.embed .ball {
  display: flex; align-items: center; position: fixed; z-index: 4; right: var(--ball-r, 12px); bottom: var(--ball-b, 12px);
  width: 40px; height: 40px; border-radius: 20px; pointer-events: auto; overflow: hidden;
  transition: width .36s cubic-bezier(.32,.72,0,1);
}
html.embed .ball[hidden] { display: none; }
html.embed .ball.open { width: var(--ball-w, 280px); }
.ball-btn { flex: none; width: 40px; height: 40px; margin-left: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.ball-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.ball-btn svg { width: 40px; height: 40px; overflow: visible; }
.ball-btn circle {
  fill: none; stroke: #fff; stroke-width: 2.2; transition: transform .2s cubic-bezier(.3,.7,.2,1); transform-origin: 50% 50%;
  /* A little glow, and a hairline of shade so the ring still reads on a white page. */
  filter: drop-shadow(0 0 .6px rgba(0,0,0,.45)) drop-shadow(0 0 2.5px rgba(255,255,255,.9)) drop-shadow(0 0 6px rgba(255,255,255,.35));
}
.ball-btn:active circle { transform: scale(.9); }
.ball-form { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; padding-left: 16px; opacity: 0; transition: opacity .18s ease; }
.ball.open .ball-form { opacity: 1; transition-delay: .12s; }
.ball-form input {
  width: 100%; height: 100%; border: 0; outline: none; background: transparent; padding: 0; color: #fff; caret-color: #fff;
  font: 400 15px/1.2 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif; text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.ball-form input::placeholder { color: rgba(255,255,255,.72); }
@media (prefers-reduced-motion: reduce) { html.embed .ball, .ball-form { transition: none; } }

/* Standalone supplies its own page colour; the account UI itself is always transparent. */
html.standalone, html.standalone body { height: 100%; overflow: hidden; }
html.standalone body { background: var(--bg); min-height: 100dvh; }
html.standalone .shell { position: fixed; inset: 0; }
html.standalone .win { position: absolute; inset: 0; }

/* The account UI fills the window — the screen, or a window of its own; its layout is ui/account/account.css. */
html.embed .win.account-ui:not(.windowed), html.standalone .win.account-ui {
  position: fixed; inset: 0; width: 100%; height: 100%; margin: 0;
}

@keyframes pane { from { opacity: 0; transform: translateY(6px); } }
.err { color: var(--danger); font-size: 12px; min-height: 0; }

/* Controls remain explicit: ink actions, readable fields and an outline on focus. */
.win .btn { min-height: 44px; font-size: 15px; letter-spacing: .6px; font-weight: 400; }
.win .btn:not(.link):not(.secondary):not(.danger):not(.plain):not(.danger-fill) { background: var(--ogs-text); color: var(--on-ink); box-shadow: none; }
.win .btn.secondary, .win .btn.danger-fill { background: transparent; color: var(--ogs-text); box-shadow: inset 0 0 0 1px var(--line); }
.win .btn.secondary:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--text-3); }
.win .btn.danger-fill { color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.win .btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.win .btn.link, .win .btn.plain { background: transparent; box-shadow: none; color: var(--ogs-text); }
.win .btn.link { min-height: 36px; padding: 0; font-size: 14px; }
.win .btn.link.muted { color: var(--text-2); }
.win .btn.danger { color: var(--danger); }
.win .btn:focus-visible, .win .icon-btn:focus-visible { outline: 1.5px solid var(--text-3); outline-offset: 3px; }
.win .btn .spin { border-color: currentColor; border-top-color: transparent; }
.win .icon-btn { background: transparent; color: var(--text-2); box-shadow: none; }
.win .icon-btn:hover { background: transparent; color: var(--ogs-text); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.win .field input, .win .field textarea {
  border-width: 0 0 1px; border-color: var(--line); border-radius: 0; background: transparent;
  padding-left: 2px; font-size: 16px; color: var(--ogs-text);
}
.win .field label { left: 2px; font-size: 16px; }
.win .field input:focus, .win .field textarea:focus { border-color: var(--ogs-text); box-shadow: 0 1px 0 var(--ogs-text); }
.win .field.invalid input { border-color: var(--danger); }
.win .field.invalid input:focus { box-shadow: 0 1px 0 var(--danger); }
.win .field input:-webkit-autofill { -webkit-box-shadow: none; -webkit-text-fill-color: var(--ogs-text); transition: background-color 99999s; }

/* The iframe and its own scrollers never scroll-chain into the host page. */
html.embed, html.embed body { overscroll-behavior: none; }

/* ---- The panel: signing in without leaving the app's page (and a third-party app's account) ---- */
.win.panel { display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 0; }
.panel-body { flex: 1; overflow: auto; padding: 14px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.panel-body h3 { margin: 4px 0 0; font-size: 30px; font-weight: 300; line-height: 1.2; letter-spacing: .6px; }
.panel-body > p { margin: 0; font-size: 15px; line-height: 1.6; }
.panel-body p:empty { display: none; }
.panel-body .links { text-align: center; font-size: 14px; }
.signin-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.signin-form form { display: flex; flex-direction: column; gap: 12px; }
.signin-form .btn svg { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.signin-form .divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.signin-form .divider::before, .signin-form .divider::after { content: ""; flex: 1; height: 1px; background: var(--sep); }
.signin-form .who {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 980px; background: transparent; border: 0;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--ogs-text); width: max-content; max-width: 100%; font-size: 14px; cursor: pointer;
}
.signin-form .who img { width: 26px; height: 26px; }
.signin-form :is(.error-box, .pk-note) { color: var(--danger); font-size: 13px; line-height: 1.4; margin: 0 4px; }
.signin-form .pk-note:empty, .signin-form .field-line { display: none; }
.signin-form .field { padding: 0; border: 0; }   /* the box around the input, not the framework's bare input field */
.signin-form :is(.sf-stage, .sf-step) { display: flex; flex-direction: column; }
.signin-form .sf-step { gap: 12px; }


/* Touch targets stay at least 44px on small screens. */
@media (max-width: 699px) {
  .win .btn.small, .win .btn.link { min-height: 44px; }
  .win .icon-btn.sm { width: 44px; height: 44px; }
  .win.panel .panel-head { padding: calc(16px + var(--safe-top, env(safe-area-inset-top, 0px))) 20px 0; }
  .win.panel .panel-body { padding: 24px 24px calc(24px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))); }
}
@media (prefers-reduced-motion: reduce) {
  html.embed .backdrop, html.embed .ball, .ball-form { transition: none; }
}
