/* Tera · the account panel (thetera.app/account). The approved site design (r5/r6): dark, dots, the pixel font of the
   logo, the app's toolbar as the menu, pixels that hop on the grid. FLAT COLORS ONLY: no gradient, no glow, no blur. */
@font-face { font-family: 'Bytesized'; src: url('/assets/Bytesized.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+20BD, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+20BD, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+20BD, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Display'; src: url('/assets/fonts/InterDisplay-Bold.woff2') format('woff2'); font-weight: 700 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+20BD, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2190-2193, U+2212, U+FEFF, U+FFFD; }

:root {
  --bg: #0b0b0b;
  --s0: #111111;
  --s1: #1a1a1a;
  --s2: #202020;
  --fg: #ececec;
  --fg2: #ababab;
  --gray: #7c7c7c;
  --line: rgba(255, 255, 255, .09);
  --bd: rgba(255, 255, 255, .14);
  --line2: rgba(255, 255, 255, .2);
  --amb: #FFBB00;
  --blue: #3889f6;
  --green: #3fb37a;
  --red: #e5534b;
  --disp: 'Inter Display', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* the site background: small round dots every 56 px; one dot sits on the page axis */
  --grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Ccircle cx='28' cy='28' r='1' fill='%231c1c1c'/%3E%3C/svg%3E");
  --side: max(24px, calc((100vw - 1180px) / 2));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
html.wait body { visibility: hidden; }
body {
  background: var(--bg) var(--grid) 50% 0 / 56px 56px repeat fixed; color: var(--fg);
  font-family: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; }
::selection { background: var(--amb); color: var(--bg); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.px { font-family: 'Bytesized', monospace; font-weight: 400; letter-spacing: .06em; line-height: 1; text-transform: uppercase; }
.mono { font-family: var(--mono); font-size: 12px; line-height: 1.6; letter-spacing: .04em; text-transform: uppercase; color: var(--gray); }
.mono b { color: var(--fg); font-weight: 500; }
.lc { text-transform: none; letter-spacing: 0; color: var(--fg2); }
:focus-visible { outline: 2px solid var(--amb); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--text); font-weight: 600; border-radius: 8px; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-md { height: 44px; padding: 0 18px; font-size: 15px; width: 100%; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15.5px; }
.btn-dl { background: var(--amb); color: #0b0b0b; }
.btn-dl:hover { background: #ffc829; }
.btn-ghost { border: 1px solid var(--line2); color: var(--fg); background: var(--bg); }
.btn-ghost:hover { border-color: var(--fg); }
.btn-blue { background: #2a63b8; color: #fff; height: 44px; padding: 0 18px; font-size: 14.5px; }
.btn-blue:hover { background: var(--blue); }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.link { color: var(--fg2); font-size: 13.5px; border-bottom: 1px solid var(--line2); padding: 0; }
.link:hover { color: var(--fg); }
.link:disabled { color: var(--gray); border-bottom-color: transparent; }
.link-a { color: var(--amb); font-weight: 600; font-size: 14px; }
.link-a:hover { text-decoration: underline; }
.arr { display: inline-block; }
html[dir="rtl"] .arr { transform: scaleX(-1); }

/* ---------- top: the same dots, fixed; the menu is the app's toolbar ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 72px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 24px;
  background: var(--bg) var(--grid) 50% 0 / 56px 56px repeat fixed;
}
.logo { display: inline-flex; align-items: center; gap: 10px; justify-self: start; direction: ltr; }
.logo img { display: block; image-rendering: pixelated; }
.logo span { font-family: 'Bytesized', monospace; font-size: 23px; line-height: 1; letter-spacing: .02em; padding-top: 1px; }
.bar { display: flex; align-items: center; gap: 2px; padding: 5px; background: var(--s1); border: 1px solid var(--bd); border-radius: 12px; }
.bar a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; color: var(--fg2); transition: color .15s, background-color .15s; }
.bar a svg { width: 16px; height: 16px; flex: none; }
.bar a:hover { color: var(--fg); background: var(--s2); }
.bar a.on { color: var(--blue); background: #172438; }
.bar i { width: 1px; height: 18px; background: var(--bd); margin: 0 4px; }
.top-act { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 18px; }
.signin { font-size: 14px; color: var(--fg); font-weight: 600; }
.signin:hover { color: var(--amb); }

/* the language picker (the same as the site: globe + code; the 10 by native name) */
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--fg2); font: 500 11px/1 var(--mono); letter-spacing: .06em; transition: color .15s, border-color .15s; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--fg); border-color: var(--bd); }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; width: 236px; padding: 5px; background: var(--s1); border: 1px solid var(--bd); border-radius: 12px; box-shadow: 4px 4px 0 #000; }
.lang-foot .lang-list { top: auto; bottom: calc(100% + 8px); }
.lang-list a { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; color: var(--fg2); }
.lang-list a span { font: 500 10.5px/1 var(--mono); letter-spacing: .04em; color: var(--gray); }
.lang-list a:hover, .lang-list a:focus-visible { background: var(--s2); color: var(--fg); }
.lang-list a[aria-current] { color: var(--fg); }
.lang-list a[aria-current] span { color: var(--amb); }

/* ---------- views ---------- */
.v { position: relative; padding: 72px var(--side) 0; }
.pxc { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
.v > *:not(.pxc), .dhead > *:not(.pxc) { position: relative; z-index: 1; }
.busy { display: flex; align-items: center; gap: 12px; color: var(--fg2); font-size: 14.5px; }
.v-boot { min-height: calc(100vh - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.spin { width: 12px; height: 12px; background: var(--amb); animation: hop 1s steps(1) infinite; flex: none; }
@keyframes hop { 0% { transform: translate(0, 0); } 25% { transform: translate(8px, -4px); } 50% { transform: translate(16px, 0); } 75% { transform: translate(8px, 4px); } }

/* the node (the app's card): 1 px light border, radius 12, a short header with the pixel title */
.node { background: var(--s0); border: 1px solid var(--bd); border-radius: 12px; }
.nh { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--fg2); }
.nh img, .nh svg { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
.nh b { font-size: 12px; color: var(--fg); padding-top: 1px; }
.pill { margin-inline-start: auto; font-size: 11.5px; color: var(--fg2); border: 1px solid var(--line2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.nb { padding: 20px; }
.note { margin-top: 16px; font-size: 11px; }
.note a { color: var(--fg2); border-bottom: 1px solid var(--line2); }
.note a:hover { color: var(--fg); }
.empty { color: var(--fg2); font-size: 14px; }
.msg { margin-top: 14px; font-size: 13.5px; color: var(--fg2); }
.msg.err { color: #ff8a80; }
.msg.ok { color: var(--green); }
.hint { color: var(--gray); font-size: 13px; }

/* ---------- signed out ---------- */
.v-login { display: flex; flex-direction: column; align-items: center; padding-bottom: 72px; min-height: calc(100vh - 100px); }
.pxbox-logo { height: 112px; width: 100%; margin-top: 56px; }
.login { width: 100%; max-width: 496px; margin-top: 24px; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.login .nh b { font-size: 11.5px; letter-spacing: .1em; }
.lead { color: var(--fg); font-size: 15px; margin-bottom: 6px; font-weight: 500; }
.what { color: var(--fg2); font-size: 13.5px; margin-bottom: 18px; }
#stepCode .lead { color: var(--fg2); font-weight: 400; margin-bottom: 18px; }
.lead b { color: var(--fg); font-weight: 600; word-break: normal; overflow-wrap: anywhere; }
.prov { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pbtn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border: 1px solid var(--bd); border-radius: 8px; background: var(--s1); font-size: 14.5px; font-weight: 500; transition: border-color .15s, background-color .15s; }
.pbtn svg { width: 18px; height: 18px; flex: none; }
.pbtn:hover { border-color: var(--line2); background: var(--s2); }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--gray); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
input { min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--bd); border-radius: 8px; height: 44px; padding: 0 14px; font-size: 15px; }
input::placeholder { color: var(--gray); }
input:focus { outline: none; border-color: var(--blue); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.otp input { width: 100%; min-width: 0; height: 56px; padding: 0; text-align: center; font: 500 24px/1 var(--mono); }
.code-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.fine { margin-top: 18px; text-align: center; color: var(--gray); font-size: 12.5px; }
.fine a { color: var(--fg2); }
.fine a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- signed in ---------- */
.v-dash { padding-bottom: 96px; }
.dhead { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 0 28px; margin: 0 calc(-1 * var(--side)); padding-inline: var(--side); }
.kicker { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxbox-plan { height: 196px; width: 100%; margin-top: 18px; }
.plan-line { font-family: var(--disp); font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: -.025em; margin-top: 18px; }
.plan-sub { color: var(--fg2); font-size: 16px; margin-top: 8px; max-width: 640px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.cta-note { margin-top: 14px; background: var(--bg); padding: 0 6px; }
.plan-warn { margin-top: 10px; font-size: 13.5px; color: var(--amb); background: var(--bg); padding: 0 6px; max-width: 560px; }

.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin-top: 36px; }
.card-dev { grid-column: span 3; }
.card-pay { grid-column: span 3; }
.card-acc { grid-column: span 2; }
.card-team { grid-column: span 2; }
.card-dl { grid-column: span 2; }
.cards .node { scroll-margin-top: 96px; }
.cards.no-dl .card-acc, .cards.no-dl .card-team { grid-column: span 3; }

/* the computer slots: one pixel square per slot, amber = in use */
.slots { display: flex; gap: 6px; margin-bottom: 16px; min-height: 16px; }
.slots i { width: 16px; height: 16px; border: 2px solid #3a3a3a; }
.slots i.on { background: var(--amb); border-color: var(--amb); }
.slots i.drop { animation: drop .5s steps(4) forwards; }
@keyframes drop { 0% { background: var(--amb); border-color: var(--amb); transform: translate(0, 0); } 100% { background: transparent; border-color: #3a3a3a; transform: translate(0, 0); } }
.devs li { border-top: 1px solid var(--line); padding: 12px 0; }
.devs li:first-child { border-top: 0; padding-top: 0; }
.dev { display: flex; align-items: center; gap: 12px; }
.dev .ic { width: 34px; height: 34px; border: 1px solid var(--bd); border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--fg2); }
.dev .ic svg { width: 16px; height: 16px; }
.dev .who { flex: 1; min-width: 0; }
.dev .nm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14.5px; }
.dev .tag { font-size: 11px; font-weight: 600; color: #0b0b0b; background: var(--amb); border-radius: 999px; padding: 1px 8px; }
.dev .when { color: var(--gray); font-size: 12.5px; }
.dev .when.idle { color: var(--fg2); }
.dev .rm { color: var(--fg2); font-size: 13px; border: 1px solid var(--line2); border-radius: 8px; height: 30px; padding: 0 12px; flex: none; }
.dev .rm:hover { color: var(--fg); border-color: var(--fg); }
.ask { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line2); border-radius: 8px; }
.ask p { font-size: 13.5px; color: var(--fg2); }
.ask p b { color: var(--fg); display: block; font-size: 14px; margin-bottom: 2px; }
.ask .acts { display: flex; gap: 8px; margin-top: 10px; }
.btn-red { background: #b3222f; color: #fff; }
.btn-red:hover { background: #d6283b; }

.pays { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pays th { text-align: start; font: 500 11px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--gray); padding: 0 8px 10px 0; }
.pays td { border-top: 1px solid var(--line); padding: 10px 8px 10px 0; white-space: nowrap; }
.pays td.amt { font-variant-numeric: tabular-nums; }
.st { font-size: 12px; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--line2); color: var(--fg2); }
.st.ok { color: var(--green); border-color: rgba(63, 179, 122, .5); }
.st.bad { color: #ff8a80; border-color: rgba(229, 83, 75, .5); }
.pays button { color: var(--fg2); border-bottom: 1px solid var(--line2); font-size: 13px; }
.pays button:hover { color: var(--fg); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--gray); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; border: 1px solid var(--line2); border-radius: 999px; padding: 1px 9px; color: var(--fg2); }
.acc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.acc-row.del { flex-direction: column; align-items: flex-start; gap: 4px; }
.acc-row.del b { font-size: 13.5px; font-weight: 600; }
.ctitle { font-family: var(--disp); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.ctxt { color: var(--fg2); font-size: 14px; margin: 6px 0 16px; }

/* ---------- footer, toast ---------- */
.foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 28px 24px 40px; }
.foot nav { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; font-size: 14px; }
.foot nav a { color: var(--fg2); }
.foot nav a:hover { color: var(--fg); }
.foot .lang { justify-self: end; }
.toast { position: fixed; z-index: 70; left: 50%; top: 84px; transform: translateX(-50%); background: var(--s1); border: 1px solid var(--bd); border-radius: 10px; padding: 10px 16px; font-size: 14px; box-shadow: 4px 4px 0 #000; max-width: calc(100vw - 32px); }
.toast::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--amb); margin-inline-end: 10px; vertical-align: 1px; }

/* ---------- smaller screens (the panel also opens from a phone) ---------- */
@media (max-width: 1060px) {
  .bar { display: none !important; }
  .top { grid-template-columns: 1fr auto; }
  .top-act { grid-column: 2; }
  .card-dev, .card-pay { grid-column: span 6; }
  .card-acc, .card-team, .card-dl { grid-column: span 3; }
  .card-dl { grid-column: span 6; }
}
@media (max-width: 720px) {
  .top { padding: 0 16px; height: 64px; }
  .top-act { gap: 10px; }
  .top-act .btn-dl span { display: none; }
  .top-act .btn-dl { padding: 0 10px; }
  .v { padding-top: 64px; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .cards .node { grid-column: auto; }
  .cards.no-dl .card-acc, .cards.no-dl .card-team { grid-column: auto; }
  .pxbox-logo { height: 80px; margin-top: 28px; }
  .pxbox-plan { height: 132px; }
  .plan-line { font-size: 24px; }
  .prov { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .row input { flex: none; height: 44px; }
  .otp { gap: 6px; }
  .otp input { height: 50px; font-size: 20px; }
  .foot { grid-template-columns: 1fr; justify-items: center; }
  .foot .lang { justify-self: center; }
  .lang-foot .lang-list { inset-inline-end: auto; left: 50%; transform: translateX(-50%); }
  .pays th:nth-child(3), .pays td:nth-child(3) { display: none; }
}

/* ---------- scripts without Latin (the pixel font only has Latin) and RTL ---------- */
html:lang(ar) body * { letter-spacing: 0 !important; }
/* Arabic has no glyphs in JetBrains Mono: a monospaced fallback splits the words ("حسابك" → "حسا بك") */
html:lang(ar) .mono { font-family: var(--text); text-transform: none; }
html:lang(ar) { --text: 'Noto Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif; --disp: 'Noto Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif; }
html:lang(hi) { --text: 'Noto Sans Devanagari', 'Nirmala UI', 'Inter', system-ui, sans-serif; --disp: 'Noto Sans Devanagari', 'Nirmala UI', 'Inter Display', system-ui, sans-serif; }
html:lang(zh-CN) { --text: 'Inter', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; --disp: 'Inter Display', 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; }
html:lang(ja) { --text: 'Inter', 'Noto Sans CJK JP', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', system-ui, sans-serif; --disp: 'Inter Display', 'Noto Sans CJK JP', 'Hiragino Sans', 'Yu Gothic UI', system-ui, sans-serif; }
html:is(:lang(ar), :lang(hi), :lang(zh), :lang(ja), :lang(ru)) .nh b.px { font-family: var(--text); font-weight: 700; letter-spacing: .02em; text-transform: none; font-size: 12.5px; }
@media (max-width: 420px) { .login .nh .pill { display: none; } }
