:root {
  color-scheme: light;
  --page: #f7f6f1;
  --surface: #fffefa;
  --surface2: #f0f2f2;
  --text: #35424c;
  --muted: #77838b;
  --border: #e3e7e8;
  --accent: #718fa9;
  --accent2: #5f7f9b;
  --accent-soft: #e8eff4;
  --button: #dce7ef;
  --button-hover: #cfdeea;
  --shadow: 0 12px 35px rgba(45, 58, 67, .06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--page);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

a {
  color: var(--accent2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.2;
  font-weight: 660;
  letter-spacing: -.045em;
}

h2 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.02em;
}

p {
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -.045em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent2);
  font-size: 13px;
  font-weight: 700;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(100%, 440px);
  padding: 32px 34px 30px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 30px;
}

.auth-card > .muted {
  margin: 8px 0 22px;
  font-size: 13px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 6px;
  background: var(--surface2);
}

.switch-button {
  min-height: 37px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.switch-button.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(30, 40, 48, .08);
  font-weight: 650;
}

.auth-form label {
  display: block;
  margin: 13px 0 5px;
  color: #66747d;
  font-size: 12px;
  font-weight: 600;
}

.auth-form input,
.demo-form input,
.demo-form select,
.demo-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.4;
}

.auth-form input:focus,
.demo-form input:focus,
.demo-form select:focus,
.demo-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(113, 143, 169, .13);
}

.auth-form input::placeholder,
.demo-form input::placeholder,
.demo-form textarea::placeholder {
  color: #a0aab0;
}

.form-error {
  min-height: 18px;
  margin: 6px 0 0;
  color: #ad6662;
  font-size: 12px;
}

.code-info {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.code-info b {
  color: var(--text);
  overflow-wrap: anywhere;
}

.code-input {
  text-align: center;
  font-size: 23px !important;
  font-weight: 650;
  letter-spacing: .35em;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 620;
  transition: background .15s, border-color .15s, transform .15s;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--button);
  color: #415b70;
  background: var(--button);
}

.button-primary:hover {
  border-color: var(--button-hover);
  background: var(--button-hover);
}

.button-secondary {
  color: var(--text);
  background: transparent;
}

.button-secondary:hover {
  background: #f5f6f5;
}

.button-wide {
  width: 100%;
  margin-top: 13px;
}

.back-link {
  display: block;
  margin: 16px auto 0;
  padding: 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.back-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 254, 250, .96);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  display: flex;
  width: min(calc(100% - 48px), 1120px);
  min-height: 66px;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
}

.main-nav {
  display: flex;
  min-width: 0;
  flex: 1;
  align-self: stretch;
  align-items: stretch;
  gap: clamp(12px, 1.8vw, 22px);
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0 1px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.nav-tab:hover {
  border-bottom-color: #b9c7ce;
  color: var(--text);
}

.nav-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--text);
  font-weight: 680;
}

.topbar-user {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent2);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.user-name {
  max-width: 130px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  transform: rotate(180deg);
}

.logout-button:hover {
  color: var(--text);
  background: #f4f6f6;
}

.page-wrap {
  width: min(calc(100% - 48px), 1040px);
  margin: 0 auto;
  padding: 42px 0 76px;
}

.welcome-block {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.welcome-block > .eyebrow {
  margin-bottom: 9px;
}

.welcome-block > h1 {
  margin-bottom: 8px;
}

.welcome-block > h1 + .muted {
  line-height: 1.6;
}

.welcome-line {
  height: 1px;
  margin: 26px 0 22px;
  background: var(--border);
}

.section-hint {
  color: var(--muted);
  font-size: 13px;
}

.demo-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0;
}

.demo-stat {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.demo-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.demo-stat b {
  display: block;
  margin-top: 5px;
  font-size: 23px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.demo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 28px;
}

.demo-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.demo-columns section {
  min-width: 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.demo-columns h2 {
  margin-bottom: 7px;
}

.demo-columns p {
  margin-bottom: 12px;
  font-size: 13px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--accent2);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.text-button:hover {
  text-decoration: underline;
}

.text-button:disabled {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

.demo-form {
  width: 100%;
  max-width: 760px;
  margin: 25px 0 30px;
  padding: 20px 22px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.demo-form h2 {
  margin-bottom: 15px;
}

.demo-form label {
  display: block;
  margin: 12px 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.demo-form textarea {
  min-height: 90px;
  resize: vertical;
}

.demo-form .button {
  margin-top: 4px;
}

.demo-list-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 12px;
}

.demo-list-title h2 {
  margin: 0;
}

.demo-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.demo-card {
  display: flex;
  min-width: 0;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}

.demo-card:hover {
  border-color: #cbd7dc;
  box-shadow: 0 5px 18px rgba(45, 58, 67, .045);
}

.demo-card h2 {
  margin: 10px 0 6px;
  font-size: 16px;
}

.demo-card p {
  line-height: 1.55;
}

.card-top,
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-top {
  flex-wrap: wrap;
}

.card-bottom {
  margin-top: 16px;
}

.card-bottom b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tag {
  color: var(--accent2);
  font-size: 11px;
  font-weight: 650;
}

.activity-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 40px));
  padding: 11px 15px;
  border-radius: 6px;
  color: #fff;
  background: #455a66;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .topbar-inner {
    width: min(calc(100% - 32px), 1120px);
    gap: 18px;
  }

  .main-nav {
    gap: 15px;
  }

  .page-wrap {
    width: min(calc(100% - 36px), 1040px);
    padding-top: 34px;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 9px;
  }

  .topbar-user {
    margin-left: auto;
  }

  .main-nav {
    order: 3;
    width: 100%;
    min-height: 44px;
    flex-basis: 100%;
    gap: 22px;
  }

  .nav-tab {
    min-height: 44px;
  }

  .page-wrap {
    padding-top: 28px;
  }
}

@media (max-width: 560px) {
  .auth-screen {
    align-items: start;
    padding: 20px 12px;
  }

  .auth-card {
    padding: 26px 21px 24px;
  }

  .auth-brand {
    margin-bottom: 24px;
  }

  .page-wrap {
    width: calc(100% - 28px);
  }

  .demo-stats,
  .demo-columns,
  .demo-list {
    grid-template-columns: 1fr;
  }

  .demo-stat {
    padding: 14px 16px;
  }

  .demo-stat b {
    font-size: 21px;
  }

  .demo-form {
    padding: 17px 15px 18px;
  }

  .demo-card {
    min-height: 0;
    padding: 16px;
  }

  .card-bottom {
    align-items: flex-start;
  }

  .demo-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .demo-links .button {
    width: 100%;
  }

  .user-name {
    max-width: 96px;
  }

  .main-nav {
    gap: 20px;
  }
}

@media (max-height: 720px) and (min-width: 561px) {
  .auth-screen {
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}


.more-wrap{position:relative;flex:0 0 auto}
.more-btn{min-height:34px;padding:0 10px;border:1px solid var(--border);border-radius:5px;color:var(--muted);background:transparent;font-size:13px}
.more-btn:hover{background:var(--surface2);color:var(--text)}
.more-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:30;display:grid;min-width:190px;padding:6px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:var(--shadow)}
.more-menu[hidden]{display:none}
.more-menu button{padding:9px 11px;border:0;border-radius:5px;text-align:left;background:transparent;color:var(--text);font-size:13px}
.more-menu button:hover{background:var(--surface2)}
.more-menu button[hidden]{display:none}
.filter-row{display:flex;gap:9px;margin:20px 0;flex-wrap:wrap}
.filter-row input{flex:1;min-width:180px}
.filter-row input,.filter-row select,.msg-form input,.msg-form select{min-height:40px;padding:8px 11px;border:1px solid var(--border);border-radius:5px;background:var(--surface);color:var(--text)}
.actions{display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.data-list{display:grid;gap:0;margin:12px 0 26px;border-top:1px solid var(--border)}
.data-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 2px;border-bottom:1px solid var(--border);font-size:13px}
.data-row span{min-width:0}
.data-row small{display:block;margin-top:3px;color:var(--muted);font-size:11px}
.plus{color:#367b60}
.minus{color:#ad6662}
.demo-note{margin-top:22px}
.chat-box{display:grid;gap:8px;margin-top:14px;padding:12px;border-radius:6px;background:var(--surface2)}
.chat-line{display:grid;gap:2px;font-size:12px}
.chat-line small{color:var(--muted);font-size:10px}
.msg-form{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.msg-form input{flex:1;min-width:150px}
.msg-form select{min-width:130px}
@media(max-width:760px){
  .topbar-inner{width:calc(100% - 24px);gap:10px;flex-wrap:wrap;padding:9px 0}
  .main-nav{order:3;width:100%;flex-basis:100%;min-height:38px}
  .more-wrap{margin-left:auto}
  .topbar-user{gap:6px}
  .page-wrap{width:calc(100% - 28px);padding:26px 0 56px}
  .demo-columns{grid-template-columns:1fr;gap:12px}
  .filter-row{display:grid;grid-template-columns:1fr 1fr}
  .filter-row input{grid-column:1/-1}
  .data-row{align-items:flex-start}
}

.match-box{margin:20px 0;padding:16px 18px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}
.match-box h2{margin-bottom:10px}
.match-box .data-row:last-child{border-bottom:0}


.theme-btn{min-height:30px;padding:0 9px;border:1px solid var(--border);border-radius:5px;color:var(--muted);background:transparent;font-size:11px}
.theme-btn:hover{color:var(--text);background:var(--surface2)}
.rate-bars{display:flex;height:88px;align-items:end;gap:5px;margin:12px 0 20px;padding:10px;border:1px solid var(--border);border-radius:7px;background:var(--surface)}
.rate-bars span{display:block;flex:1;min-width:5px;border-radius:3px 3px 0 0;background:var(--accent);opacity:.78}
:root[data-theme="dark"]{color-scheme:dark;--page:#171b20;--surface:#20262d;--surface2:#252d35;--text:#e2e8eb;--muted:#9aa7b0;--border:#35414a;--accent:#8eabc4;--accent2:#a8c2d8;--accent-soft:#293b49;--button:#34495a;--button-hover:#40596d;--shadow:0 12px 35px rgba(0,0,0,.24)}
:root[data-theme="dark"] .topbar{background:rgba(32,38,45,.96)}
:root[data-theme="dark"] .switch-button.is-active{background:#303941}
:root[data-theme="dark"] .button-secondary:hover,:root[data-theme="dark"] .more-menu button:hover{background:#303941}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
@supports(padding:max(0px)){.auth-screen,.page-wrap{padding-bottom:max(28px,env(safe-area-inset-bottom))}}


:root {
  color-scheme: light;
  --page: #e8edd7;
  --surface: #faf6e4;
  --surface2: #e0e8ce;
  --text: #2c3f2d;
  --muted: #687d63;
  --border: #a2b184;
  --accent: #6d9c4f;
  --accent2: #47783c;
  --accent-soft: #d2e4b8;
  --button: #8dbb64;
  --button-hover: #a0cd75;
  --shadow: 0 4px 0 rgba(63, 92, 48, .18), 0 9px 20px rgba(46, 67, 37, .08);
  --wood: #8b6844;
  --wood-dark: #674b32;
  --gold: #e5bd66;
}

html {
  background: var(--page);
}

body {
  position: relative;
  color: var(--text);
  background-color: var(--page);
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(255,255,224,.78), transparent 34%),
    radial-gradient(ellipse at 88% 18%, rgba(158,195,119,.20), transparent 30%),
    repeating-linear-gradient(0deg, rgba(82,112,61,.035) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(82,112,61,.035) 0 1px, transparent 1px 28px);
  background-attachment: fixed;
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
}

h1, h2, h3, .brand, .eyebrow, .nav-tab, .button, .tag, .more-btn, .theme-btn {
  font-family: "Pixelify Sans", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.18;
  font-weight: 700;
  color: var(--text);
}

h2 {
  font-size: 19px;
  font-weight: 600;
}

.eyebrow {
  font-size: 12px;
  color: var(--accent2);
  letter-spacing: .06em;
}

.brand {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 3px solid #d5e8a8;
  border-radius: 2px;
  color: #fff9dc;
  background: linear-gradient(180deg, #91c95c 0 36%, #568d42 36% 62%, #805b38 62% 100%);
  box-shadow: 0 3px 0 #526f3d, inset 0 0 0 2px rgba(36,57,35,.18);
  image-rendering: pixelated;
}

.auth-screen {
  background:
    radial-gradient(ellipse at 50% 14%, rgba(255,255,224,.62), transparent 40%),
    repeating-linear-gradient(0deg, rgba(67,105,49,.04) 0 2px, transparent 2px 34px);
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 460px);
  border: 3px solid var(--wood);
  border-radius: 3px;
  background: linear-gradient(180deg, #fff9e6, #f2edda);
  box-shadow: 0 6px 0 var(--wood-dark), 0 15px 34px rgba(56,64,38,.17);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: repeating-linear-gradient(90deg, #a87d50 0 24px, #9a7148 24px 48px);
}

.auth-brand {
  margin-top: 8px;
}

.auth-switch {
  border: 2px solid #d4d9b9;
  border-radius: 3px;
  background: #e5e9d2;
}

.switch-button {
  border-radius: 2px;
  font-family: "Pixelify Sans", sans-serif;
  font-size: 16px;
}

.switch-button.is-active {
  color: #f9f3dc;
  background: #587d42;
  box-shadow: 0 2px 0 #3e6032;
}

.auth-form label, .demo-form label {
  color: #536c4c;
  font-weight: 800;
}

.auth-form input,
.demo-form input,
.demo-form select,
.demo-form textarea,
.filter-row input,
.filter-row select,
.msg-form input,
.msg-form select {
  border: 2px solid #bdc9a1;
  border-radius: 2px;
  color: #2e422f;
  background: #fffdf0;
  box-shadow: inset 0 2px 0 rgba(78,103,55,.05);
  font-family: "Nunito Sans", sans-serif;
}

.auth-form input:focus,
.demo-form input:focus,
.demo-form select:focus,
.demo-form textarea:focus,
.filter-row input:focus,
.filter-row select:focus,
.msg-form input:focus {
  border-color: #75a750;
  box-shadow: 0 0 0 3px rgba(115,164,77,.18);
}

.auth-form input::placeholder,
.demo-form input::placeholder,
.demo-form textarea::placeholder {
  color: #97a184;
}

.topbar {
  border-bottom: 3px solid #536e43;
  background: rgba(242, 244, 218, .96);
  box-shadow: 0 4px 0 rgba(70,94,51,.10);
}

.topbar-inner {
  min-height: 72px;
  gap: clamp(12px, 2vw, 24px);
}

.main-nav {
  gap: clamp(8px, 1.5vw, 18px);
}

.nav-tab {
  border-bottom: 4px solid transparent;
  color: #647b5a;
  font-size: 15px;
  font-weight: 600;
}

.nav-tab:hover {
  border-bottom-color: #b0c78d;
  color: #304a32;
}

.nav-tab.is-active {
  border-bottom-color: #5f9145;
  color: #2f552f;
  font-weight: 700;
}

.topbar-user {
  gap: 8px;
}

.user-avatar {
  border: 2px solid #86a66a;
  border-radius: 2px;
  color: #fff9e1;
  background: #65894c;
  box-shadow: 0 2px 0 #48673a;
}

.user-name {
  color: #506b4b;
  font-weight: 800;
}

.logout-button, .theme-btn, .more-btn {
  border: 2px solid #9eaf82;
  border-radius: 2px;
  color: #486340;
  background: #edf1d9;
  box-shadow: 0 2px 0 rgba(66,96,49,.18);
}

.logout-button:hover, .theme-btn:hover, .more-btn:hover {
  border-color: #759b5b;
  background: #dfe9c8;
}

.page-wrap {
  padding-top: 38px;
}

.welcome-block {
  max-width: 960px;
}

.demo-stat,
.demo-form,
.demo-card,
.match-box {
  border: 2px solid #9eae7e;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--surface), #f1efd9);
  box-shadow: 0 3px 0 rgba(77,103,57,.17);
}

.demo-stat {
  position: relative;
  overflow: hidden;
  padding-top: 20px;
}

.demo-stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: repeating-linear-gradient(90deg, #75a951 0 18px, #8cbd65 18px 36px);
}

.demo-stat span {
  color: #6a7e5d;
  font-weight: 800;
}

.demo-stat b {
  color: #355b35;
  font-family: "Pixelify Sans", sans-serif;
  font-size: 25px;
  font-weight: 600;
}

.demo-form {
  max-width: 790px;
}

.demo-card {
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.demo-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: repeating-linear-gradient(90deg, #7da955 0 16px, #9bc36d 16px 32px);
}

.demo-card:hover {
  transform: translateY(-2px);
  border-color: #729753;
  box-shadow: 0 5px 0 rgba(69,97,49,.18), 0 10px 18px rgba(44,65,35,.08);
}

.demo-card h2 {
  font-size: 20px;
  font-weight: 600;
}

.card-top, .card-bottom {
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #c4ad6e;
  border-radius: 2px;
  color: #755b25;
  background: #f4e6b8;
  font-size: 13px;
}

.button {
  min-height: 42px;
  border: 2px solid #597b43;
  border-radius: 2px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 3px 0 #3d5c34;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.button-primary {
  border-color: #4b713c;
  color: #fffbe9;
  background: linear-gradient(180deg, #83b95c, #65964a);
}

.button-primary:hover {
  border-color: #3f6734;
  background: linear-gradient(180deg, #94c96c, #75a856);
  box-shadow: 0 4px 0 #3d5c34;
  transform: translateY(-1px);
}

.button-secondary {
  color: #49603f;
  background: #e6ebd4;
}

.button-secondary:hover {
  background: #dce8c7;
}

.button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #3d5c34;
}

.text-button {
  color: #4c7c3b;
  font-weight: 800;
}

.text-button:hover {
  color: #2c5d32;
}

.more-menu {
  border: 2px solid #8da476;
  border-radius: 3px;
  background: #f8f4e2;
  box-shadow: 0 4px 0 rgba(51,75,40,.18), 0 12px 22px rgba(46,61,38,.15);
}

.more-menu button {
  border-radius: 2px;
  color: #344a31;
}

.more-menu button:hover {
  background: #e2ebd0;
}

.filter-row input, .filter-row select, .msg-form input, .msg-form select {
  min-height: 42px;
}

.actions {
  gap: 10px 14px;
}

.data-list {
  border-top: 2px solid #a4b38a;
}

.data-row, .activity-item {
  border-bottom: 1px solid #c7d0b5;
  color: var(--text);
}

.data-row small {
  color: var(--muted);
}

.chat-box {
  border: 1px solid #bdcba6;
  border-radius: 3px;
  background: #e8eddb;
}

.chat-line {
  padding: 7px 9px;
  border-left: 3px solid #8eac69;
  background: #f8f6e7;
}

.match-box {
  background: linear-gradient(180deg, #f8f6e8, #e9edda);
}

.rate-bars {
  border: 2px solid #9eae7e;
  border-radius: 3px;
  background: #f4f0d9;
}

.rate-bars span {
  border-radius: 0;
  background: #72a454;
  image-rendering: pixelated;
}

.toast {
  border: 2px solid #adc18c;
  border-radius: 3px;
  color: #fffce9;
  background: #3f6740;
  box-shadow: 0 4px 0 #29472e, 0 10px 24px rgba(30,49,28,.25);
  font-weight: 800;
}

.theme-btn {
  min-height: 32px;
  padding: 0 10px;
  font-family: "Pixelify Sans", sans-serif;
  font-size: 15px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #17241d;
  --surface: #26382b;
  --surface2: #304432;
  --text: #e9ebd5;
  --muted: #b0bd9b;
  --border: #506b4b;
  --accent: #91bf68;
  --accent2: #b7d98a;
  --accent-soft: #38523b;
  --button: #6d9950;
  --button-hover: #81aa5c;
  --shadow: 0 4px 0 rgba(0,0,0,.25), 0 12px 26px rgba(0,0,0,.22);
}

:root[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(87,124,72,.24), transparent 34%),
    radial-gradient(ellipse at 85% 8%, rgba(194,150,74,.10), transparent 25%),
    repeating-linear-gradient(0deg, rgba(183,214,145,.025) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(183,214,145,.025) 0 1px, transparent 1px 30px);
}

:root[data-theme="dark"] .auth-screen {
  background:
    radial-gradient(ellipse at 50% 12%, rgba(193,157,91,.12), transparent 42%),
    repeating-linear-gradient(0deg, rgba(184,211,139,.025) 0 2px, transparent 2px 34px);
}

:root[data-theme="dark"] .auth-card {
  border-color: #896744;
  background: linear-gradient(180deg, #344435, #273729);
}

:root[data-theme="dark"] .auth-card::before {
  background: repeating-linear-gradient(90deg, #976d47 0 24px, #805938 24px 48px);
}

:root[data-theme="dark"] .auth-form label,
:root[data-theme="dark"] .demo-form label {
  color: #cad5b2;
}

:root[data-theme="dark"] .auth-form input,
:root[data-theme="dark"] .demo-form input,
:root[data-theme="dark"] .demo-form select,
:root[data-theme="dark"] .demo-form textarea,
:root[data-theme="dark"] .filter-row input,
:root[data-theme="dark"] .filter-row select,
:root[data-theme="dark"] .msg-form input,
:root[data-theme="dark"] .msg-form select {
  border-color: #637d5d;
  color: #eef0dc;
  background: #1f3024;
}

:root[data-theme="dark"] .auth-form input::placeholder,
:root[data-theme="dark"] .demo-form input::placeholder,
:root[data-theme="dark"] .demo-form textarea::placeholder {
  color: #9aaa8c;
}

:root[data-theme="dark"] .topbar {
  border-bottom-color: #405b3b;
  background: rgba(28,43,33,.96);
}

:root[data-theme="dark"] .nav-tab {
  color: #b2c09f;
}

:root[data-theme="dark"] .nav-tab:hover,
:root[data-theme="dark"] .nav-tab.is-active {
  color: #e7efcf;
}

:root[data-theme="dark"] .user-name {
  color: #b8c89f;
}

:root[data-theme="dark"] .logout-button,
:root[data-theme="dark"] .theme-btn,
:root[data-theme="dark"] .more-btn {
  border-color: #607a54;
  color: #e0ebcb;
  background: #304431;
}

:root[data-theme="dark"] .demo-stat,
:root[data-theme="dark"] .demo-form,
:root[data-theme="dark"] .demo-card,
:root[data-theme="dark"] .match-box {
  border-color: #56724e;
  background: linear-gradient(180deg, #2c402f, #26382b);
  box-shadow: 0 3px 0 rgba(0,0,0,.20);
}

:root[data-theme="dark"] .demo-stat::before,
:root[data-theme="dark"] .demo-card::before {
  background: repeating-linear-gradient(90deg, #5d914a 0 18px, #76a95a 18px 36px);
}

:root[data-theme="dark"] .demo-stat span {
  color: #bbcaab;
}

:root[data-theme="dark"] .demo-stat b {
  color: #e5edcc;
}

:root[data-theme="dark"] .tag {
  border-color: #8d7946;
  color: #f0d894;
  background: #51452c;
}

:root[data-theme="dark"] .button-primary {
  border-color: #81aa5e;
  color: #18271b;
  background: linear-gradient(180deg, #9dcf6d, #77a852);
}

:root[data-theme="dark"] .button-secondary {
  border-color: #5b7654;
  color: #e3ebd4;
  background: #344936;
}

:root[data-theme="dark"] .text-button {
  color: #b6d78a;
}

:root[data-theme="dark"] .more-menu {
  border-color: #5b7654;
  background: #293d2e;
}

:root[data-theme="dark"] .more-menu button {
  color: #e3ebd4;
}

:root[data-theme="dark"] .more-menu button:hover {
  background: #3b523e;
}

:root[data-theme="dark"] .data-list {
  border-top-color: #526d4b;
}

:root[data-theme="dark"] .data-row,
:root[data-theme="dark"] .activity-item {
  border-bottom-color: #435a41;
}

:root[data-theme="dark"] .chat-box {
  border-color: #506a49;
  background: #203326;
}

:root[data-theme="dark"] .chat-line {
  background: #2d4332;
}

:root[data-theme="dark"] .rate-bars {
  border-color: #58734f;
  background: #213226;
}

:root[data-theme="dark"] .rate-bars span {
  background: #8ebc65;
}

:root[data-theme="dark"] .switch-button.is-active {
  color: #f6f1dc;
  background: #587e43;
}

:root[data-theme="dark"] .button-secondary:hover,
:root[data-theme="dark"] .more-menu button:hover,
:root[data-theme="dark"] .logout-button:hover,
:root[data-theme="dark"] .theme-btn:hover {
  background: #405b41;
}

:focus-visible {
  outline: 3px solid #e0b85f;
  outline-offset: 3px;
}

::selection {
  color: #263d29;
  background: #d9e8a8;
}

@media (max-width: 760px) {
  .topbar-inner {
    gap: 8px 12px;
  }

  .main-nav {
    gap: 18px;
  }

  .brand {
    font-size: 21px;
  }

  .theme-btn {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 27px 19px 23px;
  }

  .demo-card h2 {
    font-size: 19px;
  }

  .data-row {
    gap: 10px;
    flex-wrap: wrap;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-card:hover,
  .button-primary:hover {
    transform: none;
  }
}

.assistant-text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.65}


/* Book-style authentication */
:root {
  --book-paper: #eee5ce;
  --book-paper-shadow: #d2c4a4;
  --book-ink: #30251d;
  --book-muted: #786b5b;
  --book-wood: #633b27;
  --book-wood-dark: #291911;
}
.auth-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 28px 16px 36px;
  overflow: hidden;
  background: transparent !important;
}
.auth-screen::after {
  position: fixed;
  z-index: 50;
  inset: 0;
  content: "";
  pointer-events: none;
  background: #030508;
  opacity: 0;
  transition: opacity .22s ease;
}
.auth-screen.is-closing::after { opacity: 1; }
.auth-stage {
  display: grid;
  width: min(100%, 540px);
  justify-items: center;
  gap: 15px;
  perspective: 1800px;
}
.auth-book {
  position: relative;
  width: min(100%, 510px);
  height: min(710px, calc(100svh - 120px));
  min-height: 555px;
  padding: 15px 14px 15px 27px;
  border: 4px solid #291710;
  border-radius: 13px 10px 10px 13px;
  background:
    repeating-linear-gradient(4deg, rgba(255,220,155,.035) 0 2px, transparent 2px 8px),
    linear-gradient(90deg, #3d2116 0%, #8b5635 5%, #603a27 11%, #75462d 100%);
  box-shadow:
    inset 5px 0 0 rgba(15,8,5,.34),
    inset -4px 0 0 rgba(226,163,103,.17),
    0 5px 0 #180e0a,
    0 24px 60px rgba(0,0,0,.58);
  transform-style: preserve-3d;
  transition: transform .38s ease, filter .3s ease, opacity .3s ease;
}
.auth-book::before {
  position: absolute;
  z-index: 3;
  inset: 8px auto 8px 8px;
  width: 10px;
  border-left: 2px solid rgba(229,182,123,.5);
  border-right: 1px solid rgba(24,11,7,.65);
  border-radius: 6px;
  content: "";
  background: repeating-linear-gradient(180deg, rgba(211,160,111,.7) 0 4px, transparent 4px 12px);
  opacity: .76;
  pointer-events: none;
}
.auth-book::after {
  position: absolute;
  z-index: 4;
  top: 11px;
  bottom: 11px;
  left: 25px;
  width: 2px;
  content: "";
  background: rgba(102,49,36,.28);
  box-shadow: 2px 0 0 rgba(255,255,255,.24);
  pointer-events: none;
}
.book-cover-spine {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(90deg, #2c170f, #75452d 47%, #482719);
  box-shadow: inset -3px 0 0 rgba(0,0,0,.28), inset 3px 0 0 rgba(230,177,123,.15);
}
.book-page-stack {
  position: absolute;
  inset: 13px 8px 13px 29px;
  border: 1px solid #a68a60;
  border-radius: 3px 6px 6px 3px;
  background:
    repeating-linear-gradient(180deg, #e6dcc5 0 2px, #cbbd9f 2px 3px),
    #e5dcc7;
  box-shadow: 2px 2px 0 rgba(20,10,5,.3), 5px 4px 0 rgba(20,10,5,.24);
}
.book-leaf {
  position: absolute;
  z-index: 2;
  inset: 13px 12px 13px 28px;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .68s cubic-bezier(.2,.72,.18,1);
}
.auth-book.is-page-2 .book-leaf { transform: rotateY(-180deg); }
.book-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 23px 27px 23px 35px;
  border: 1px solid #c6b491;
  border-radius: 3px 7px 7px 3px;
  color: var(--book-ink);
  background:
    radial-gradient(ellipse at 80% 5%, rgba(255,255,255,.56), transparent 38%),
    repeating-linear-gradient(0deg, rgba(120,91,53,.025) 0 1px, transparent 1px 5px),
    linear-gradient(110deg, #f5efdE, var(--book-paper) 62%, #e9dfc8);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), inset 5px 0 13px rgba(107,67,35,.11);
  backface-visibility: hidden;
}
.book-page::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  width: 2px;
  content: "";
  background: repeating-linear-gradient(180deg, #a3483d 0 6px, transparent 6px 12px);
  opacity: .7;
}
.book-page::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 17px;
  width: 1px;
  content: "";
  background: rgba(161,83,62,.25);
}
.book-page--back { transform: rotateY(180deg); }
.book-page-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 28px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(133,105,69,.24);
  color: #786b5b;
  font: 12px/1.3 "Pixelify Sans", "Trebuchet MS", sans-serif;
}
.book-chapter { opacity: .72; letter-spacing: .035em; }
.page-counter { flex: 0 0 auto; font-size: 13px; color: #57483a; }
.book-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
}
.book-insignia {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: #593b2b;
  font: 700 19px/1 "Pixelify Sans", sans-serif;
}
.book-insignia-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 2px solid #79563b;
  color: #f4e8cd;
  background: linear-gradient(145deg, #9c7149, #583822);
  box-shadow: 2px 2px 0 rgba(65,39,21,.22);
}
.book-kicker {
  margin: 0 0 7px;
  color: #8c6c4e;
  font: 12px/1.4 "Pixelify Sans", sans-serif;
  letter-spacing: .07em;
}
.book-title {
  margin: 0 0 8px;
  color: #37271d;
  font: 700 clamp(23px, 4vw, 30px)/1.2 "Pixelify Sans", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}
.book-subtitle {
  margin: 0 0 20px;
  color: #7a6a58;
  font-size: 13px;
  line-height: 1.55;
}
.book-form { display: block; width: 100%; }
.book-form label {
  display: block;
  margin: 10px 0 4px;
  color: #554432;
  font: 13px/1.35 "Pixelify Sans", "Trebuchet MS", sans-serif;
}
.book-form input {
  width: 100%;
  min-height: 39px;
  margin: 0 0 4px;
  padding: 8px 10px;
  border: 1px solid #bbaa89;
  border-radius: 2px;
  outline: 0;
  color: #33271e;
  background: rgba(255,252,239,.83);
  box-shadow: inset 0 1px 3px rgba(66,46,25,.08), 0 1px 0 rgba(255,255,255,.65);
  font: 14px/1.4 "Nunito Sans", sans-serif;
}
.book-form input:focus {
  border-color: #95704b;
  box-shadow: 0 0 0 3px rgba(149,112,75,.14);
}
.book-form input::placeholder { color: #a69a86; }
.book-form .form-error { min-height: 17px; margin-top: 5px; color: #a23d31; }
.book-page-link, .book-inline-link {
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 0 2px;
  border: 0;
  color: #795339;
  background: transparent;
  font: 13px/1.4 "Pixelify Sans", sans-serif;
  text-align: left;
  cursor: pointer;
}
.book-page-link:hover, .book-inline-link:hover { color: #a54b35; text-decoration: underline; }
.book-page-link--back { margin-top: 12px; }
.book-bottom-mark {
  position: absolute;
  right: 21px;
  bottom: 13px;
  color: rgba(111,85,56,.4);
  font-size: 18px;
}
.book-content--registration .book-insignia { margin-bottom: 12px; }
.book-content--registration .book-subtitle { margin-bottom: 7px; }
.book-content--registration .book-form label { margin-top: 6px; font-size: 12px; }
.book-content--registration .book-form input { min-height: 34px; padding: 6px 9px; font-size: 13px; }
.book-content--registration .book-title { font-size: clamp(21px,3.6vw,27px); }
.book-content--registration .form-error { min-height: 13px; margin: 3px 0; }
.book-content--registration .book-page-link--back { margin-top: auto; }
.auth-legacy-tabs { display: none !important; }
.code-info { margin: 4px 0 18px; color: #756550; font-size: 13px; }
.code-info b { color: #3b2c20; }
.code-input { text-align: center; font-size: 21px !important; letter-spacing: .35em !important; }
.book-inline-link { display: block; margin-top: 10px; font-size: 12px; }
.book-inline-link + .book-inline-link { margin-top: 4px; }
.book-actions { display: grid; width: min(100%, 420px); grid-template-columns: 1fr 1fr; gap: 12px; }
.book-action-button {
  min-height: 43px;
  border: 2px solid rgba(15,9,6,.75);
  border-radius: 3px;
  color: #eee7d6;
  background: linear-gradient(#625e58, #403d39);
  box-shadow: 0 3px 0 #211b17, inset 0 1px 0 rgba(255,255,255,.2);
  font: 14px "Pixelify Sans", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}
.book-action-button:hover { color: #fff7e4; background: linear-gradient(#77716a, #514b44); }
.book-action-button.button-primary { border-color: #35251b; color: #f7eeda; background: linear-gradient(#8b6343, #63432e); }
.book-action-button.button-primary:hover { background: linear-gradient(#a2744e, #754d32); }
.book-action-button:active { transform: translateY(2px); }
.auth-screen.is-closing .auth-book {
  transform: rotateY(68deg) scale(.9);
  filter: brightness(.25);
  opacity: .15;
}
.auth-screen.is-closing .book-actions {
  transform: translateY(14px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
#app.is-entering { opacity: 0; }
#app.is-entering.is-ready { animation: book-app-appear .45s ease forwards; }
@keyframes book-app-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
:root[data-theme="dark"] body { background-color: #111418; background-image: none; }
:root[data-theme="dark"] .auth-screen { background: transparent !important; }
@media (max-width: 560px) {
  .auth-screen { padding: 16px 10px 24px; }
  .auth-stage { width: min(100%, 440px); gap: 12px; }
  .auth-book {
    width: 100%;
    height: min(690px, calc(100svh - 102px));
    min-height: 560px;
    padding: 11px 9px 11px 22px;
    border-radius: 10px 8px 8px 10px;
  }
  .book-leaf { inset: 10px 8px 10px 23px; }
  .book-page { padding: 18px 16px 18px 27px; }
  .book-page-top { margin-bottom: 18px; font-size: 10px; }
  .page-counter { font-size: 11px; }
  .book-insignia { margin-bottom: 16px; }
  .book-content--registration .book-form label { margin-top: 4px; }
  .book-content--registration .book-form input { min-height: 31px; }
  .book-actions { width: min(100%, 360px); gap: 8px; }
  .book-action-button { min-height: 41px; font-size: 12px; }
}
@media (max-height: 690px) {
  .auth-book { height: calc(100svh - 105px); min-height: 0; }
  .book-page { padding-top: 16px; padding-bottom: 14px; }
  .book-page-top { margin-bottom: 12px; }
  .book-insignia { margin-bottom: 12px; }
  .book-content--registration .book-form label { margin-top: 3px; }
  .book-content--registration .book-form input { min-height: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-leaf, .auth-book, .auth-screen::after, .book-actions { transition-duration: .01ms !important; }
}


/* Two voxel worlds: cave and forest surface */
html {
  background: #10151a;
  min-height: 100%;
  transition: background-color .75s ease;
}
body {
  isolation: isolate;
  min-height: 100vh;
  background: transparent !important;
  transition: color .7s ease, background-color .7s ease;
}
.world-scenery {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #111820;
}
body > :not(.world-scenery):not(.world-transition) {
  position: relative;
  z-index: 1;
}
body > .world-transition { z-index: 999; }
.world-layer {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: none;
  transition: opacity 1.15s cubic-bezier(.2,.65,.25,1), filter 1.15s ease;
  will-change: opacity, filter;
}
.world-layer--cave {
  background-image: url("../assets/backgrounds/night.png");
  opacity: 1;
  filter: none;
}
.world-layer--surface {
  background-image: url("../assets/backgrounds/day.png");
  opacity: 0;
  filter: none;
}
html[data-world="surface"] .world-layer--cave {
  opacity: 0;
  filter: brightness(.32) saturate(.45);
}
html[data-world="surface"] .world-layer--surface {
  opacity: 1;
  filter: saturate(1.13) brightness(1.02) contrast(1.04);
}
.world-light-shafts {
  position: absolute;
  inset: -20%;
  opacity: .16;
  background:
    linear-gradient(114deg,transparent 35%,rgba(255,231,168,.14) 41%,transparent 49%),
    linear-gradient(106deg,transparent 46%,rgba(248,241,192,.12) 51%,transparent 58%),
    radial-gradient(ellipse at 72% 25%,rgba(255,223,142,.25),transparent 37%);
  mix-blend-mode: screen;
  animation: world-rays 18s ease-in-out infinite alternate;
  transition: opacity .9s ease;
}
html[data-world="cave"] .world-light-shafts {
  opacity: .12;
  background:
    radial-gradient(ellipse at 12% 55%,rgba(255,142,56,.29),transparent 22%),
    radial-gradient(ellipse at 89% 53%,rgba(255,135,48,.22),transparent 23%),
    linear-gradient(180deg,rgba(4,9,15,.22),transparent 50%,rgba(5,9,15,.4));
  mix-blend-mode: screen;
}
html[data-world="surface"] .world-light-shafts { opacity: .62; }
.world-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 44%,transparent 30%,rgba(5,13,18,.18) 100%),
    linear-gradient(180deg,rgba(4,13,18,.10),transparent 28%,transparent 72%,rgba(6,14,16,.25));
  opacity: .9;
  transition: background 1s ease, opacity 1s ease;
}
html[data-world="cave"] .world-atmosphere {
  background:
    radial-gradient(ellipse at 50% 55%,transparent 18%,rgba(0,4,9,.48) 100%),
    linear-gradient(180deg,rgba(3,7,12,.48),transparent 34%,rgba(4,7,11,.32));
}
.world-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: .64;
  transition: opacity .8s ease;
}
.world-particles i {
  position: absolute;
  bottom: -12px;
  left: 8%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f4c67b;
  box-shadow: 0 0 9px 3px rgba(246,177,91,.42), 0 0 22px rgba(255,179,82,.2);
  opacity: 0;
  animation: world-dust 16s linear infinite;
}
.world-particles i:nth-child(2) { left:18%; animation-delay:-6s; animation-duration:19s; transform:scale(.7); }
.world-particles i:nth-child(3) { left:32%; animation-delay:-10s; animation-duration:14s; transform:scale(1.2); }
.world-particles i:nth-child(4) { left:47%; animation-delay:-3s; animation-duration:21s; transform:scale(.6); }
.world-particles i:nth-child(5) { left:61%; animation-delay:-12s; animation-duration:17s; transform:scale(.9); }
.world-particles i:nth-child(6) { left:72%; animation-delay:-8s; animation-duration:18s; transform:scale(1.1); }
.world-particles i:nth-child(7) { left:83%; animation-delay:-4s; animation-duration:15s; transform:scale(.65); }
.world-particles i:nth-child(8) { left:92%; animation-delay:-14s; animation-duration:22s; transform:scale(.8); }
.world-particles i:nth-child(9) { left:26%; animation-delay:-15s; animation-duration:24s; transform:scale(.45); }
.world-particles i:nth-child(10) { left:54%; animation-delay:-9s; animation-duration:20s; transform:scale(.55); }
html[data-world="surface"] .world-particles i {
  width: 3px;
  height: 6px;
  border-radius: 1px 5px 1px 5px;
  background: #e7efac;
  box-shadow: 0 0 12px 3px rgba(229,244,170,.48);
}
html[data-world="surface"] .world-particles { opacity: .8; }

:root[data-world="cave"] {
  color-scheme: dark;
  --page: #101820;
  --surface: rgba(23,31,38,.86);
  --surface2: rgba(37,45,49,.88);
  --text: #e2e5d9;
  --muted: #aab0a2;
  --border: rgba(175,187,170,.24);
  --accent: #d99b55;
  --accent2: #f2bd77;
  --accent-soft: rgba(192,119,55,.18);
  --button: #875a34;
  --button-hover: #a56c3c;
  --shadow: 0 18px 45px rgba(0,0,0,.34);
}
:root[data-world="surface"] {
  color-scheme: light;
  --page: #9ab99b;
  --surface: rgba(241,241,218,.87);
  --surface2: rgba(218,230,197,.9);
  --text: #263d2e;
  --muted: #667e68;
  --border: rgba(61,94,65,.28);
  --accent: #5b8e4c;
  --accent2: #3e6f3c;
  --accent-soft: rgba(100,150,76,.17);
  --button: #79a95c;
  --button-hover: #8cbc69;
  --shadow: 0 16px 42px rgba(21,49,31,.19);
}
:root[data-world="cave"] .topbar {
  border-bottom: 1px solid rgba(213,163,105,.27);
  background: linear-gradient(180deg,rgba(18,27,35,.82),rgba(15,23,31,.62)) !important;
  box-shadow: 0 8px 35px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.07);
}
:root[data-world="surface"] .topbar {
  border-bottom: 1px solid rgba(63,99,59,.25);
  background: linear-gradient(180deg,rgba(230,239,212,.79),rgba(205,224,190,.62)) !important;
  box-shadow: 0 8px 34px rgba(34,72,42,.13), inset 0 1px rgba(255,255,255,.52);
}
:root[data-world="cave"] .nav-tab,
:root[data-world="cave"] .user-name { color: #c4c7b9; }
:root[data-world="cave"] .nav-tab:hover,
:root[data-world="cave"] .nav-tab.is-active { color: #fff1d1; }
:root[data-world="surface"] .nav-tab,
:root[data-world="surface"] .user-name { color: #526c53; }
:root[data-world="surface"] .nav-tab:hover,
:root[data-world="surface"] .nav-tab.is-active { color: #203c2a; }
:root[data-world="cave"] .demo-card,
:root[data-world="cave"] .demo-stat,
:root[data-world="cave"] .demo-form,
:root[data-world="cave"] .match-box,
:root[data-world="cave"] .chat-box {
  border: 1px solid rgba(198,174,140,.23);
  border-radius: 5px;
  color: #e4e5d9;
  background: linear-gradient(145deg,rgba(46,55,58,.83),rgba(22,31,39,.86));
  box-shadow: 0 5px 0 rgba(0,0,0,.19), inset 0 1px rgba(255,255,255,.055), 0 14px 36px rgba(0,0,0,.16);
  backdrop-filter: blur(14px) saturate(1.12);
}
:root[data-world="surface"] .demo-card,
:root[data-world="surface"] .demo-stat,
:root[data-world="surface"] .demo-form,
:root[data-world="surface"] .match-box,
:root[data-world="surface"] .chat-box {
  border: 1px solid rgba(61,102,61,.27);
  border-radius: 5px;
  color: #2d4432;
  background: linear-gradient(145deg,rgba(248,247,224,.86),rgba(211,229,194,.82));
  box-shadow: 0 5px 0 rgba(48,83,48,.12), inset 0 1px rgba(255,255,255,.65), 0 14px 36px rgba(21,59,29,.12);
  backdrop-filter: blur(14px) saturate(1.15);
}
:root[data-world="cave"] .demo-stat span,
:root[data-world="cave"] .demo-card p,
:root[data-world="cave"] .section-hint { color: #b9beb0; }
:root[data-world="surface"] .demo-stat span,
:root[data-world="surface"] .demo-card p,
:root[data-world="surface"] .section-hint { color: #647b63; }
:root[data-world="cave"] .button-primary {
  border: 1px solid #d1a56e;
  color: #fff1d4;
  background: linear-gradient(180deg,#a96e3a,#70452b);
  box-shadow: 0 3px 0 #42281b,inset 0 1px rgba(255,255,255,.18),0 5px 16px rgba(0,0,0,.18);
}
:root[data-world="surface"] .button-primary {
  border: 1px solid #8ab477;
  color: #173820;
  background: linear-gradient(180deg,#b2d48d,#78a65a);
  box-shadow: 0 3px 0 #42683a,inset 0 1px rgba(255,255,255,.45),0 5px 16px rgba(38,77,37,.14);
}
:root[data-world="cave"] .button-secondary,
:root[data-world="cave"] .theme-btn,
:root[data-world="cave"] .more-btn,
:root[data-world="cave"] .logout-button {
  border-color: rgba(207,171,122,.3);
  color: #e7d9bf;
  background: rgba(35,43,47,.72);
}
:root[data-world="surface"] .button-secondary,
:root[data-world="surface"] .theme-btn,
:root[data-world="surface"] .more-btn,
:root[data-world="surface"] .logout-button {
  border-color: rgba(75,111,69,.32);
  color: #36583a;
  background: rgba(220,234,202,.78);
}
:root[data-world="cave"] .more-menu {
  border-color: rgba(210,164,111,.27);
  background: rgba(23,32,38,.96);
  box-shadow: 0 18px 45px rgba(0,0,0,.45);
  backdrop-filter: blur(16px);
}
:root[data-world="surface"] .more-menu {
  border-color: rgba(80,116,68,.3);
  background: rgba(236,242,215,.96);
  box-shadow: 0 18px 45px rgba(31,69,33,.22);
  backdrop-filter: blur(16px);
}
:root[data-world="cave"] .more-menu button { color: #e6e2d5; }
:root[data-world="surface"] .more-menu button { color: #304b35; }
:root[data-world="cave"] .data-list { border-top-color: rgba(213,181,138,.23); }
:root[data-world="surface"] .data-list { border-top-color: rgba(77,109,72,.26); }
:root[data-world="cave"] .data-row,
:root[data-world="cave"] .activity-item { border-bottom-color: rgba(193,174,142,.19); }
:root[data-world="surface"] .data-row,
:root[data-world="surface"] .activity-item { border-bottom-color: rgba(74,107,69,.22); }
:root[data-world="cave"] .tag {
  border-color: rgba(229,174,100,.42);
  color: #f5d49d;
  background: rgba(129,82,43,.42);
}
:root[data-world="surface"] .tag {
  border-color: rgba(81,129,66,.36);
  color: #355e39;
  background: rgba(139,180,101,.2);
}
:root[data-world="cave"] .text-button { color: #f1bd79; }
:root[data-world="surface"] .text-button { color: #477d42; }
:root[data-world="cave"] .chat-line { color: #e6e5da; background: rgba(48,58,59,.62); }
:root[data-world="surface"] .chat-line { color: #304a35; background: rgba(221,235,203,.7); }
:root[data-world="cave"] .filter-row input,
:root[data-world="cave"] .filter-row select,
:root[data-world="cave"] .msg-form input,
:root[data-world="cave"] .msg-form select {
  border-color: rgba(195,171,138,.32);
  color: #ece7d9;
  background: rgba(23,32,38,.86);
}
:root[data-world="surface"] .filter-row input,
:root[data-world="surface"] .filter-row select,
:root[data-world="surface"] .msg-form input,
:root[data-world="surface"] .msg-form select {
  border-color: rgba(71,110,63,.31);
  color: #2d4933;
  background: rgba(246,247,223,.86);
}
:root[data-world="cave"] .toast {
  border-color: rgba(209,164,111,.34);
  color: #f0e4cf;
  background: rgba(27,36,42,.94);
}
:root[data-world="surface"] .toast {
  border-color: rgba(75,112,67,.28);
  color: #314d35;
  background: rgba(235,243,216,.95);
}

/* The book belongs to the same world; keep its paper warm and readable. */
.auth-screen { background: transparent !important; }
.auth-theme-btn {
  position: fixed;
  z-index: 80;
  top: 22px;
  right: 25px;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid rgba(224,192,143,.38);
  border-radius: 4px;
  color: #f3e6c9;
  background: rgba(22,31,36,.72);
  box-shadow: 0 4px 18px rgba(0,0,0,.23),inset 0 1px rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
  font: 14px "Pixelify Sans","Trebuchet MS",sans-serif;
}
:root[data-world="surface"] .auth-theme-btn {
  border-color: rgba(63,102,64,.36);
  color: #315336;
  background: rgba(231,241,214,.78);
}
.auth-theme-btn:hover { transform: translateY(-1px); filter: brightness(1.12); }
.auth-stage { position: relative; }
.book-quill {
  position: absolute;
  z-index: 8;
  top: 105px;
  right: -80px;
  width: 118px;
  height: 285px;
  pointer-events: none;
  transform: rotate(11deg);
  transform-origin: 50% 80%;
  filter: drop-shadow(0 18px 12px rgba(0,0,0,.4));
  animation: quill-hover 5.2s ease-in-out infinite;
}
.book-quill svg { width: 100%; height: 78%; overflow: visible; }
.quill-inkwell {
  position: absolute;
  right: 18px;
  bottom: 0;
  width: 60px;
  height: 46px;
  border: 3px solid #38271b;
  border-radius: 8px 8px 12px 12px;
  background: linear-gradient(90deg,#151b20,#46505a 25%,#1a2025 60%,#0c1117);
  box-shadow: inset 0 4px 0 rgba(255,255,255,.16),0 4px 0 #120f0e,0 0 19px rgba(228,166,92,.16);
}
.quill-inkwell::before {
  position: absolute;
  top: -8px;
  left: -5px;
  width: 64px;
  height: 10px;
  border: 2px solid #9f8255;
  border-radius: 4px;
  content: "";
  background: linear-gradient(#c4a16b,#67472e);
}
.quill-inkwell span {
  position: absolute;
  top: 3px;
  left: 19px;
  width: 14px;
  height: 18px;
  border-radius: 50%;
  background: #090e18;
  box-shadow: 0 0 7px rgba(8,12,20,.7);
}
@keyframes quill-hover {
  0%,100% { transform: rotate(11deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-7px); }
}
:root[data-world="cave"] .book-quill { filter: drop-shadow(0 18px 12px rgba(0,0,0,.55)) drop-shadow(0 0 8px rgba(247,169,91,.13)); }
:root[data-world="surface"] .book-quill { filter: drop-shadow(0 18px 12px rgba(24,50,29,.3)) drop-shadow(0 0 12px rgba(249,232,160,.2)); }

/* Cinematic transition: cave explosion opens the forest; the forest is swallowed by cave darkness. */
.world-transition {
  position: fixed;
  z-index: 999;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.transition-flash,.transition-rings,.transition-glow {
  position: absolute;
  inset: 0;
}
.transition-flash {
  opacity: 0;
  background: radial-gradient(circle at 50% 48%,rgba(255,250,216,1) 0,rgba(255,223,145,.9) 9%,rgba(255,164,80,.38) 24%,transparent 58%);
}
.transition-rings {
  inset: auto;
  top: 50%;
  left: 50%;
  width: 8vmax;
  height: 8vmax;
  border: 5px solid rgba(255,242,199,.95);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(255,230,162,.9),inset 0 0 24px rgba(255,230,162,.7);
  opacity: 0;
  transform: translate(-50%,-50%) scale(.08);
}
.transition-glow {
  background: linear-gradient(180deg,rgba(4,8,14,.93),rgba(5,8,12,.98));
  transform: scaleY(0);
  transform-origin: bottom center;
}
.world-transition.to-light {
  visibility: visible;
  opacity: 1;
}
.world-transition.to-light .transition-flash { animation: forest-burst .95s ease-out both; }
.world-transition.to-light .transition-rings { animation: forest-shockwave 1.4s cubic-bezier(.12,.7,.2,1) both; }
.world-transition.to-light .transition-glow {
  background: radial-gradient(circle at 50% 48%,rgba(255,247,207,.3),transparent 45%);
  animation: forest-afterglow 1.5s ease-out both;
}
.world-transition.to-dark {
  visibility: visible;
  opacity: 1;
}
.world-transition.to-dark .transition-glow { animation: cave-fill 1.28s cubic-bezier(.6,0,.45,1) both; }
.world-transition.to-dark .transition-flash {
  background: radial-gradient(circle at 15% 63%,rgba(255,163,72,.85),rgba(230,104,37,.26) 15%,transparent 38%),radial-gradient(circle at 88% 58%,rgba(255,163,72,.72),rgba(230,104,37,.2) 14%,transparent 37%);
  animation: torch-awake 1.15s ease-out .75s both;
}
@keyframes world-rays {
  from { transform: translate3d(-1.5%,0,0) rotate(-1deg); }
  to { transform: translate3d(1.5%,1%,0) rotate(1.5deg); }
}
@keyframes world-dust {
  0% { transform: translate3d(0,0,0) scale(.45); opacity: 0; }
  12% { opacity: .75; }
  78% { opacity: .45; }
  100% { transform: translate3d(45px,-110vh,0) scale(1.2); opacity: 0; }
}
@keyframes forest-burst {
  0% { opacity: 0; transform: scale(.65); }
  22% { opacity: 1; transform: scale(1.05); }
  50% { opacity: .8; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1.75); }
}
@keyframes forest-shockwave {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.08); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(32); }
}
@keyframes forest-afterglow {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes cave-fill {
  0% { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}
@keyframes torch-awake {
  0% { opacity: 0; filter: blur(16px); }
  35% { opacity: .95; filter: blur(2px); }
  60% { opacity: .48; filter: blur(12px); }
  100% { opacity: 0; filter: blur(18px); }
}
@media (max-width: 760px) {
  .book-quill { top: 88px; right: -38px; width: 92px; height: 228px; opacity: .92; }
}
@media (max-width: 560px) {
  .auth-theme-btn { top: 10px; right: 10px; min-height: 34px; font-size: 12px; }
  .book-quill { top: 65px; right: -14px; width: 72px; height: 175px; opacity: .72; }
}
@media (prefers-reduced-motion: reduce) {
  .world-layer,.world-light-shafts,.world-particles i,.book-quill,.world-transition *,
  .auth-theme-btn { animation: none !important; transition: none !important; }
}


/* Full Minecraft Rus visual pass */
@font-face {
  font-family: "Minecraft Rus";
  src: url("../assets/MinecraftRus.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --mc-font: "Minecraft Rus", "Courier New", monospace;
  --mc-edge-light: rgba(255,255,255,.24);
  --mc-edge-dark: rgba(0,0,0,.4);
}
html, body, body * {
  font-family: var(--mc-font) !important;
  font-synthesis: weight;
  letter-spacing: 0 !important;
}
body {
  font-size: 13px;
  line-height: 1.75;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}
button, input, select, textarea {
  font: 12px/1.6 var(--mc-font) !important;
}
h1 {
  font-size: clamp(23px, 3vw, 31px) !important;
  line-height: 1.6 !important;
  letter-spacing: 0 !important;
  text-shadow: 2px 2px 0 rgba(0,0,0,.18);
}
h2 {
  font-size: 17px !important;
  line-height: 1.65 !important;
  letter-spacing: 0 !important;
}
h3, .eyebrow, .tag, .small, .muted, label, .data-row small {
  letter-spacing: 0 !important;
}
.eyebrow {
  font-size: 11px !important;
  text-shadow: 1px 1px 0 rgba(0,0,0,.12);
}
.small, .muted, .section-hint, .demo-note, .data-row small {
  font-size: 11px !important;
  line-height: 1.7 !important;
}
.world-layer {
  image-rendering: pixelated;
  transform: scale(1.035);
  transition: opacity 1.2s steps(14, end), filter 1.2s ease, transform 1.5s ease;
}
.world-light-shafts {
  mix-blend-mode: screen;
  filter: blur(3px);
  animation: world-rays 22s ease-in-out infinite alternate;
}
.world-atmosphere {
  backdrop-filter: saturate(1.12);
}
:root[data-world="cave"] .world-layer--cave {
  filter: saturate(.85) brightness(.8) contrast(1.18);
}
:root[data-world="surface"] .world-layer--surface {
  filter: saturate(1.2) brightness(1.05) contrast(1.08);
  transform: scale(1.01);
}

/* Chunky, beveled game HUD */
.topbar {
  min-height: 62px;
  border-bottom-width: 3px !important;
  border-style: solid !important;
  backdrop-filter: blur(16px) saturate(1.18) !important;
}
.topbar-inner {
  min-height: 62px;
  gap: 20px;
}
.brand {
  font-size: 19px !important;
  text-shadow: 2px 2px 0 rgba(0,0,0,.18);
}
.brand-mark {
  border-radius: 0 !important;
  image-rendering: pixelated;
  box-shadow: 2px 2px 0 rgba(0,0,0,.42), inset 0 2px 0 rgba(255,255,255,.28) !important;
}
.nav-tab {
  padding: 0 9px !important;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  font-size: 11px !important;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-tab:hover {
  background: rgba(255,255,255,.09) !important;
}
.nav-tab.is-active {
  border-bottom-color: #e4c36b !important;
  text-shadow: 1px 1px 0 rgba(0,0,0,.32);
}
.user-avatar {
  border-radius: 0 !important;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.22);
  image-rendering: pixelated;
}
.theme-btn, .more-btn, .logout-button {
  min-height: 35px !important;
  border-width: 2px !important;
  border-radius: 0 !important;
  box-shadow: 0 3px 0 rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.18) !important;
  font-size: 10px !important;
  text-shadow: 1px 1px 0 rgba(0,0,0,.2);
}
.logout-button { width: 35px !important; height: 35px !important; }
.more-menu {
  border-width: 2px !important;
  border-radius: 0 !important;
  box-shadow: 0 5px 0 rgba(0,0,0,.32), 0 18px 40px rgba(0,0,0,.28) !important;
}
.more-menu button {
  border-radius: 0 !important;
  font-size: 11px !important;
}
.page-wrap {
  padding-top: 34px !important;
  padding-bottom: 70px !important;
}
.welcome-block {
  max-width: 1060px !important;
}
.welcome-block > h1 {
  margin-bottom: 9px;
}

/* Inventory-slot-like statistics and pixel panels */
.demo-stats {
  gap: 14px !important;
  margin: 24px 0 !important;
}
.demo-stat, .demo-card, .demo-form, .match-box, .chat-box {
  position: relative;
  border-radius: 0 !important;
  border-width: 2px !important;
  box-shadow:
    0 4px 0 rgba(0,0,0,.34),
    inset 0 2px 0 rgba(255,255,255,.13),
    inset 0 -3px 0 rgba(0,0,0,.16),
    0 14px 32px rgba(0,0,0,.14) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
}
.demo-stat {
  min-height: 116px;
  padding: 20px !important;
  overflow: visible !important;
}
.demo-stat::before, .demo-card::before {
  height: 6px !important;
  opacity: .9;
  image-rendering: pixelated;
}
.demo-stat span {
  font-size: 10px !important;
  text-transform: uppercase;
}
.demo-stat b {
  margin-top: 10px !important;
  font-size: clamp(20px, 3vw, 28px) !important;
  line-height: 1.5 !important;
  text-shadow: 2px 2px 0 rgba(0,0,0,.22);
}
.demo-stat small {
  display: block;
  margin-top: 6px;
  font-size: 10px !important;
}
.demo-card {
  padding: 21px !important;
  transition: transform .12s steps(3,end), box-shadow .12s, filter .12s;
}
.demo-card:hover {
  transform: translateY(-3px) !important;
  filter: brightness(1.08);
  box-shadow: 0 7px 0 rgba(0,0,0,.32), inset 0 2px 0 rgba(255,255,255,.17), 0 18px 36px rgba(0,0,0,.23) !important;
}
.demo-card h2 {
  margin-top: 12px;
}
.demo-card p {
  font-size: 12px;
  line-height: 1.8;
}
.demo-form, .match-box {
  padding: 20px !important;
}
.demo-form h2, .match-box h2 {
  margin-bottom: 17px;
}
.card-top, .card-bottom, .data-row {
  gap: 12px;
}
.tag {
  padding: 5px 9px !important;
  border-radius: 0 !important;
  border-width: 2px !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.18);
  font-size: 9px !important;
  text-transform: uppercase;
}
.data-list {
  border-top-width: 2px !important;
}
.data-row {
  padding: 14px 5px !important;
  font-size: 11px !important;
}
.data-row b { font-size: 11px; }
.data-row small { font-size: 9px !important; }
.demo-columns section {
  padding: 20px !important;
  border: 2px solid var(--border) !important;
  border-radius: 0 !important;
  background: rgba(20,30,28,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), 0 3px 0 rgba(0,0,0,.13);
}
.demo-links { gap: 10px !important; }
.demo-links .button { min-height: 42px; }

/* Button bevel: Minecraft inventory / menu */
.button {
  min-height: 39px !important;
  padding: 8px 13px !important;
  border-width: 2px !important;
  border-radius: 0 !important;
  box-shadow: 0 3px 0 rgba(0,0,0,.42), inset 0 2px 0 rgba(255,255,255,.19) !important;
  text-shadow: 1px 1px 0 rgba(0,0,0,.22);
  transition: transform .08s steps(2,end), filter .12s, box-shadow .12s !important;
}
.button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.button:active {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.4), inset 0 2px 0 rgba(0,0,0,.12) !important;
}
.button-primary {
  text-shadow: 1px 1px 0 rgba(0,0,0,.25);
}
.text-button {
  font: 10px/1.6 var(--mc-font) !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.filter-row input, .filter-row select, .msg-form input, .msg-form select,
.demo-form input, .demo-form select, .demo-form textarea {
  min-height: 40px !important;
  padding: 8px 10px !important;
  border-width: 2px !important;
  border-radius: 0 !important;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.09), 0 2px 0 rgba(0,0,0,.15) !important;
  font-size: 11px !important;
}
.demo-form label {
  display: block;
  margin: 13px 0 5px;
  font-size: 10px !important;
  text-transform: uppercase;
}
:root[data-world="cave"] .demo-columns section {
  border-color: rgba(188,168,138,.24) !important;
  background: rgba(13,21,28,.35);
}
:root[data-world="surface"] .demo-columns section {
  border-color: rgba(67,103,60,.28) !important;
  background: rgba(225,239,201,.28);
}

/* Minecraft book cover and paper */
.auth-book {
  border-radius: 0 !important;
  border-width: 6px !important;
  box-shadow:
    0 7px 0 #17100c,
    0 0 0 2px rgba(238,196,129,.22),
    0 28px 68px rgba(0,0,0,.58),
    inset 4px 0 0 rgba(255,255,255,.08),
    inset -5px 0 0 rgba(0,0,0,.3) !important;
}
.book-page {
  border-radius: 0 !important;
  border-width: 2px !important;
  background:
    repeating-linear-gradient(90deg,rgba(120,91,53,.035) 0 2px,transparent 2px 5px),
    repeating-linear-gradient(0deg,rgba(120,91,53,.025) 0 2px,transparent 2px 6px),
    linear-gradient(135deg,#fff7df,#eee3c5 70%,#e2d3b1) !important;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.3), inset 6px 0 14px rgba(98,68,38,.12) !important;
}
.book-page-top, .book-title, .book-insignia, .book-kicker,
.book-form label, .book-page-link, .book-inline-link,
.book-action-button, .page-counter, .book-chapter {
  font-family: var(--mc-font) !important;
}
.book-page-top { font-size: 10px !important; }
.book-title {
  font-size: clamp(21px,3vw,27px) !important;
  line-height: 1.65 !important;
  text-shadow: 1px 1px 0 rgba(95,68,39,.17);
}
.book-subtitle { font-size: 10px !important; line-height: 1.8 !important; }
.book-form label { font-size: 10px !important; text-transform: uppercase; }
.book-form input { font-size: 11px !important; }
.book-page-link, .book-inline-link { font-size: 10px !important; }
.book-actions { gap: 11px !important; }
.book-action-button {
  min-height: 46px !important;
  border-radius: 0 !important;
  border-width: 3px !important;
  font-size: 12px !important;
  box-shadow: 0 4px 0 #17110d, inset 0 2px 0 rgba(255,255,255,.2) !important;
}
.book-quill {
  right: -96px !important;
  filter: drop-shadow(4px 7px 0 rgba(0,0,0,.32)) drop-shadow(0 12px 18px rgba(0,0,0,.4)) !important;
}
:root[data-world="surface"] .book-quill {
  filter: drop-shadow(4px 7px 0 rgba(41,67,34,.2)) drop-shadow(0 12px 16px rgba(29,55,31,.18)) !important;
}
.auth-theme-btn {
  border-radius: 0 !important;
  border-width: 2px !important;
  font: 10px/1.6 var(--mc-font) !important;
  box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.2) !important;
}
:root[data-world="cave"] .auth-theme-btn { color: #fff0c9; background: rgba(33,38,43,.88); }
:root[data-world="surface"] .auth-theme-btn { color: #365638; background: rgba(235,244,215,.92); }

/* crisp pixel cursor, focus and low-end fallback */
:focus-visible {
  outline: 3px solid #f4d36e !important;
  outline-offset: 3px !important;
}
::selection { background: rgba(239,205,104,.58); color: inherit; }
@media (max-width: 760px) {
  .topbar-inner { gap: 9px 12px !important; }
  .nav-tab { padding: 0 7px !important; }
  .demo-card, .demo-form, .match-box { padding: 16px !important; }
  .book-quill { right: -38px !important; width: 84px !important; }
}
@media (max-width: 560px) {
  body { font-size: 11px; }
  .topbar { min-height: 0; }
  .topbar-inner { min-height: 54px; }
  .brand { font-size: 16px !important; }
  .main-nav { gap: 8px !important; }
  .nav-tab { font-size: 9px !important; }
  .page-wrap { padding-top: 23px !important; }
  .demo-stat { min-height: 98px; padding: 14px !important; }
  .demo-stat b { font-size: 19px !important; }
  .demo-card h2 { font-size: 15px !important; }
  .book-quill { right: -12px !important; top: 62px !important; width: 66px !important; opacity: .8; }
}


/* Reliable, unmistakable transition overlay — above every app layer */
body > #worldTransition.world-transition {
  position: fixed !important;
  z-index: 2147483000 !important;
  inset: 0 !important;
  display: block !important;
  isolation: isolate !important;
  overflow: hidden !important;
  pointer-events: none !important;
  contain: strict;
  background: transparent !important;
}
#worldTransition.world-transition.to-light,
#worldTransition.world-transition.to-dark {
  visibility: visible !important;
  opacity: 1 !important;
}
#worldTransition .transition-flash,
#worldTransition .transition-rings,
#worldTransition .transition-glow,
#worldTransition .transition-blocks {
  position: absolute;
  pointer-events: none;
}
#worldTransition .transition-flash {
  z-index: 4;
  inset: -12%;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, #fffef0 0 2%, #fff3bd 5%, rgba(255,204,103,.96) 10%, rgba(255,136,53,.76) 23%, rgba(255,112,43,.22) 40%, transparent 66%);
  mix-blend-mode: screen;
  filter: blur(2px);
}
#worldTransition .transition-rings {
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 9vmax;
  height: 9vmax;
  border: 8px solid rgba(255,248,214,.98);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 16px 8px rgba(255,226,155,.8), inset 0 0 18px rgba(255,249,220,.9), 0 0 70px rgba(255,153,64,.58);
  transform: translate(-50%,-50%) scale(.05);
}
#worldTransition .transition-glow {
  z-index: 1;
  inset: 0;
  background: #070d12;
  transform: scaleY(0);
  transform-origin: bottom center;
}
#worldTransition .transition-blocks {
  z-index: 5;
  inset: 0;
}
#worldTransition .transition-blocks i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--block-size, 24px);
  height: var(--block-size, 24px);
  opacity: 0;
  border: 2px solid rgba(255,242,200,.82);
  background: linear-gradient(135deg,#fff0b0 0 18%,#e8a54e 19% 58%,#a65a30 59% 100%);
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.28), 3px 4px 0 rgba(77,40,20,.34), 0 0 16px rgba(255,176,79,.55);
}
#worldTransition .transition-blocks i:nth-child(1) { --dx:-40vw; --dy:-31vh; --rot:-220deg; --block-size:32px; }
#worldTransition .transition-blocks i:nth-child(2) { --dx:34vw; --dy:-37vh; --rot:180deg; --block-size:23px; }
#worldTransition .transition-blocks i:nth-child(3) { --dx:-31vw; --dy:35vh; --rot:270deg; --block-size:27px; }
#worldTransition .transition-blocks i:nth-child(4) { --dx:43vw; --dy:29vh; --rot:320deg; --block-size:35px; }
#worldTransition .transition-blocks i:nth-child(5) { --dx:-15vw; --dy:-43vh; --rot:150deg; --block-size:19px; }
#worldTransition .transition-blocks i:nth-child(6) { --dx:18vw; --dy:42vh; --rot:250deg; --block-size:29px; }
#worldTransition .transition-blocks i:nth-child(7) { --dx:-48vw; --dy:7vh; --rot:210deg; --block-size:18px; }
#worldTransition .transition-blocks i:nth-child(8) { --dx:49vw; --dy:-7vh; --rot:140deg; --block-size:26px; }
#worldTransition .transition-blocks i:nth-child(9) { --dx:-8vw; --dy:27vh; --rot:300deg; --block-size:15px; }
#worldTransition .transition-blocks i:nth-child(10) { --dx:8vw; --dy:-28vh; --rot:190deg; --block-size:21px; }
#worldTransition .transition-blocks i:nth-child(11) { --dx:-25vw; --dy:-19vh; --rot:240deg; --block-size:14px; }
#worldTransition .transition-blocks i:nth-child(12) { --dx:27vw; --dy:16vh; --rot:330deg; --block-size:17px; }
#worldTransition .transition-blocks i:nth-child(13) { --dx:5vw; --dy:8vh; --rot:260deg; --block-size:12px; }
#worldTransition .transition-blocks i:nth-child(14) { --dx:-5vw; --dy:-12vh; --rot:180deg; --block-size:28px; }

#worldTransition.to-light::before {
  position: absolute;
  z-index: 2;
  inset: -40%;
  content: "";
  opacity: 0;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg 8deg, rgba(255,228,163,.22) 8.5deg 9.5deg, transparent 10deg 17deg);
  mask-image: radial-gradient(circle at center,black 0 10%,transparent 59%);
  animation: mc-explosion-rays 1.45s ease-out both;
}
#worldTransition.to-light::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 12%, rgba(255,242,190,.27) 38%, rgba(9,18,20,.32) 100%);
  animation: mc-explosion-vignette 1.5s ease-out both;
}
#worldTransition.to-light .transition-flash {
  animation: mc-explosion-flash 1.05s cubic-bezier(.12,.72,.25,1) both !important;
}
#worldTransition.to-light .transition-rings {
  animation: mc-explosion-wave 1.4s cubic-bezier(.1,.66,.14,1) both !important;
}
#worldTransition.to-light .transition-glow {
  transform: none;
  background: radial-gradient(circle at 50% 50%,rgba(255,250,216,.46),rgba(255,197,107,.18) 34%,transparent 70%);
  animation: mc-explosion-bloom 1.45s ease-out both !important;
}
#worldTransition.to-light .transition-blocks i {
  animation: mc-block-fragment 1.28s cubic-bezier(.12,.66,.22,1) both;
}
#worldTransition.to-dark .transition-glow {
  transform: scaleY(0);
  transform-origin: bottom center;
  animation: cave-fill 1.28s cubic-bezier(.6,0,.45,1) both !important;
}
#worldTransition.to-dark .transition-flash {
  animation: torch-awake 1.35s ease-out .8s both !important;
}
@keyframes mc-explosion-flash {
  0% { opacity: 0; transform: scale(.25); }
  11% { opacity: 1; transform: scale(.7); }
  33% { opacity: .92; transform: scale(1.08); }
  57% { opacity: .5; transform: scale(1.24); }
  100% { opacity: 0; transform: scale(1.55); }
}
@keyframes mc-explosion-wave {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.05); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(34); }
}
@keyframes mc-explosion-rays {
  0% { opacity: 0; transform: scale(.2) rotate(-12deg); }
  18% { opacity: .82; }
  100% { opacity: 0; transform: scale(1.2) rotate(24deg); }
}
@keyframes mc-explosion-vignette {
  0%,18% { opacity: 0; }
  36% { opacity: .72; }
  100% { opacity: 0; }
}
@keyframes mc-explosion-bloom {
  0% { opacity: .95; }
  100% { opacity: 0; }
}
@keyframes mc-block-fragment {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.1) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(.45) rotate(var(--rot)); }
}

/* Even with OS reduced-motion enabled, keep the world-change event visible. */
@media (prefers-reduced-motion: reduce) {
  #worldTransition.to-light .transition-flash { animation-duration: .7s !important; }
  #worldTransition.to-light .transition-rings { animation-duration: .8s !important; }
  #worldTransition.to-light .transition-blocks i { animation-duration: .75s !important; }
  #worldTransition.to-light::before,
  #worldTransition.to-light::after,
  #worldTransition.to-light .transition-glow { animation-duration: .8s !important; }
  #worldTransition.to-dark .transition-glow,
  #worldTransition.to-dark .transition-flash { animation-duration: .8s !important; }
}


/* Minecraft-style explosion and cave rebuilding */
.world-cave-build {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(14,minmax(0,1fr));
  grid-template-rows: repeat(8,minmax(0,1fr));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.world-cave-build i {
  display: block;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  border: 1px solid rgba(9,15,20,.68);
  background:
    linear-gradient(135deg,rgba(190,197,192,.24) 0 5%,transparent 6% 45%,rgba(0,0,0,.27) 46% 100%),
    repeating-linear-gradient(0deg,rgba(255,255,255,.035) 0 3px,transparent 3px 8px),
    linear-gradient(145deg,#727a7c 0%,#4b565b 34%,#303b42 70%,#202a31 100%);
  box-shadow: inset 3px 3px 0 rgba(210,218,214,.13), inset -4px -4px 0 rgba(0,0,0,.36), 0 0 0 1px rgba(0,0,0,.42);
  transform: scale(1.12);
}
.world-cave-build i:nth-child(3n) {
  background:
    linear-gradient(135deg,rgba(207,211,204,.2),transparent 40%),
    linear-gradient(145deg,#606c70,#343f45 64%,#1a242c);
}
.world-cave-build i:nth-child(4n) {
  background:
    linear-gradient(135deg,rgba(171,158,135,.22),transparent 35%),
    linear-gradient(145deg,#74695b,#494b4a 55%,#283139);
}
.world-cave-build i:nth-child(7n) {
  background:
    linear-gradient(135deg,rgba(195,205,205,.3),transparent 40%),
    linear-gradient(145deg,#849092,#505b60 58%,#26323a);
}
.world-cave-shade {
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg,rgba(5,10,16,.16),rgba(5,10,16,.44)),
    radial-gradient(ellipse at center,transparent 5%,rgba(2,7,12,.52) 100%);
}
.world-torch-glow {
  position: absolute;
  z-index: 6;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 24% 38% at 8% 69%,rgba(255,145,53,.46),transparent 75%),
    radial-gradient(ellipse 23% 37% at 92% 65%,rgba(255,153,57,.39),transparent 76%),
    radial-gradient(ellipse 36% 18% at 49% 104%,rgba(255,179,77,.14),transparent 75%);
  mix-blend-mode: screen;
  filter: blur(12px);
}
.world-scenery.is-building-cave .world-cave-build {
  opacity: 1;
}
.world-scenery.is-building-cave .world-cave-build i {
  animation: cave-cube-assemble .48s steps(4,end) var(--tile-delay,0ms) both;
}
.world-scenery.is-building-cave .world-cave-shade {
  animation: cave-shade-grow 1.95s ease-out both;
}
.world-scenery.is-building-cave .world-torch-glow {
  animation: cave-torches-wake 1.2s ease-out 1.32s both;
}
@keyframes cave-cube-assemble {
  0% { opacity: 0; filter: brightness(1.7); transform: scale(1.16) translateY(-7px); }
  24% { opacity: .9; }
  100% { opacity: 1; filter: brightness(.72); transform: scale(1) translateY(0); }
}
@keyframes cave-shade-grow {
  0% { opacity: 0; }
  28% { opacity: .08; }
  100% { opacity: .76; }
}
@keyframes cave-torches-wake {
  0% { opacity: 0; filter: blur(24px); }
  45% { opacity: .95; filter: blur(10px); }
  75% { opacity: .5; }
  100% { opacity: .68; filter: blur(12px); }
}

/* Reverse transition remains behind the interface text: never black out the UI. */
#worldTransition.to-dark .transition-glow {
  display: none !important;
}
#worldTransition.to-dark .transition-blocks,
#worldTransition.to-dark .transition-particles {
  display: none !important;
}
#worldTransition.to-dark .transition-flash {
  inset: 0;
  background:
    radial-gradient(ellipse 22% 35% at 9% 70%,rgba(255,178,91,.34),transparent 76%),
    radial-gradient(ellipse 20% 32% at 91% 66%,rgba(255,166,75,.3),transparent 76%);
  mix-blend-mode: screen;
  filter: blur(12px);
  animation: torch-awake 1.45s ease-out 1.1s both !important;
}
#worldTransition.to-dark .transition-rings { display: none; }

/* Dust and rubble plume based on the supplied Minecraft explosion reference. */
#worldTransition .transition-particles {
  position: absolute;
  z-index: 6;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
#worldTransition .transition-particles i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: var(--dust-size,5px);
  height: var(--dust-size,5px);
  opacity: 0;
  background: #f5f4eb;
  image-rendering: pixelated;
  box-shadow:
    var(--dust-size,5px) 0 0 #f5f4eb,
    calc(var(--dust-size,5px) * -1) 0 0 #e9e9e2,
    0 var(--dust-size,5px) 0 #eeeDE5,
    0 calc(var(--dust-size,5px) * -1) 0 #fff;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.5));
}
#worldTransition .transition-particles i:nth-child(4n) {
  background: #888b87;
  box-shadow:
    var(--dust-size,5px) 0 0 #a3a39c,
    calc(var(--dust-size,5px) * -1) 0 0 #777b79,
    0 var(--dust-size,5px) 0 #999b95,
    0 calc(var(--dust-size,5px) * -1) 0 #c2c1b7;
}
#worldTransition .transition-particles i:nth-child(7n) {
  background: #534b40;
  box-shadow:
    var(--dust-size,5px) 0 0 #746b5d,
    calc(var(--dust-size,5px) * -1) 0 0 #4b443a,
    0 var(--dust-size,5px) 0 #655a4d,
    0 calc(var(--dust-size,5px) * -1) 0 #877a68;
}
#worldTransition.to-light .transition-particles i {
  animation: mc-smoke-particle 1.72s cubic-bezier(.12,.68,.22,1) var(--dust-delay,0ms) both;
}
#worldTransition.to-light .transition-blocks i {
  animation: mc-block-fragment 1.48s cubic-bezier(.12,.66,.22,1) var(--fragment-delay,0ms) both !important;
}
#worldTransition.to-light .transition-flash {
  background:
    radial-gradient(ellipse 15% 12% at 50% 48%,#fff 0 15%,rgba(250,250,245,.98) 32%,transparent 100%),
    radial-gradient(ellipse 34% 28% at 50% 50%,rgba(240,241,232,.94),rgba(176,181,178,.65) 50%,transparent 100%),
    radial-gradient(ellipse 53% 39% at 50% 51%,rgba(255,255,255,.5),rgba(151,155,151,.26) 58%,transparent 100%),
    radial-gradient(circle at 50% 50%,rgba(255,205,133,.3),transparent 68%) !important;
  mix-blend-mode: screen;
  filter: blur(1px) !important;
}
#worldTransition.to-light .transition-rings {
  border-width: 6px;
  border-color: rgba(244,246,242,.96);
  box-shadow: 0 0 24px 9px rgba(242,245,239,.85), inset 0 0 18px rgba(255,255,255,.9), 0 0 70px rgba(174,183,179,.55);
}
@keyframes mc-smoke-particle {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x,0px)),calc(-50% + var(--y,0px))) scale(.18);
  }
  11% { opacity: 1; }
  34% { opacity: .96; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx,0px)),calc(-50% + var(--dy,0px))) scale(1.18);
  }
}

/* Dark book inputs use stone and charcoal, never the old green palette. */
:root[data-theme="dark"] #registrationPage .book-form input,
:root[data-theme="dark"] #registrationPage .book-form input[type="email"],
:root[data-theme="dark"] #registrationPage .book-form input[type="password"],
:root[data-theme="dark"] #registrationPage .book-form input[type="text"],
:root[data-theme="dark"] #registrationPage #codeForm input {
  border: 2px solid #555f64 !important;
  color: #f1eee3 !important;
  background: linear-gradient(180deg,#353d42 0%,#252d32 100%) !important;
  box-shadow: inset 0 3px 5px rgba(0,0,0,.48), 0 2px 0 rgba(0,0,0,.32) !important;
}
:root[data-theme="dark"] #registrationPage .book-form input::placeholder {
  color: #aab2b1 !important;
}
:root[data-theme="dark"] #registrationPage .book-form input:focus {
  border-color: #b58a58 !important;
  box-shadow: inset 0 3px 5px rgba(0,0,0,.4), 0 0 0 3px rgba(221,164,94,.2) !important;
}
:root[data-theme="dark"] #registrationPage .book-form label {
  color: #6b5541 !important;
}
@media (prefers-reduced-motion: reduce) {
  .world-scenery.is-building-cave .world-cave-build i {
    animation-duration: .18s !important;
    animation-delay: 0ms !important;
  }
  .world-scenery.is-building-cave .world-cave-shade { animation-duration: .3s !important; }
  .world-scenery.is-building-cave .world-torch-glow { animation-duration: .3s !important; animation-delay: 0ms !important; }
  #worldTransition.to-light .transition-particles i,
  #worldTransition.to-light .transition-blocks i { animation-duration: .65s !important; }
}


/* Actual Minecraft terrain fragments: grass, dirt and stone cubes */
#worldTransition .transition-blocks i {
  border: 2px solid rgba(27,34,30,.9);
  background:
    linear-gradient(180deg,#83a957 0 23%,transparent 23%),
    linear-gradient(135deg,#8d6848 0%,#70503b 54%,#493a31 100%) !important;
  box-shadow:
    inset 3px 3px 0 rgba(255,255,255,.19),
    inset -4px -4px 0 rgba(0,0,0,.34),
    3px 4px 0 rgba(0,0,0,.4),
    0 0 12px rgba(255,255,255,.12) !important;
}
#worldTransition .transition-blocks i:nth-child(3n) {
  background:
    linear-gradient(135deg,rgba(255,255,255,.18),transparent 44%),
    linear-gradient(145deg,#a9b0ae 0%,#747f80 48%,#414c52 100%) !important;
}
#worldTransition .transition-blocks i:nth-child(4n) {
  background:
    linear-gradient(180deg,#6f9347 0 20%,transparent 20%),
    linear-gradient(145deg,#a27b56 0%,#79563e 55%,#4b3930 100%) !important;
}
#worldTransition .transition-blocks i:nth-child(7n) {
  background:
    linear-gradient(135deg,#a3aaa8 0%,#777f7e 42%,#434c50 100%) !important;
}


/* Layering fix: the cinematic effect belongs to the scenery, behind all UI. */
.world-scenery {
  z-index: 0 !important;
  isolation: isolate;
}
.world-scenery > #worldTransition {
  position: absolute !important;
  z-index: 20 !important;
  inset: 0 !important;
  display: block !important;
  overflow: hidden !important;
  pointer-events: none !important;
  contain: strict;
}
#worldTransition.world-transition {
  position: absolute !important;
  z-index: 20 !important;
  inset: 0 !important;
  width: 100%;
  height: 100%;
  visibility: hidden;
  opacity: 0;
  background: transparent !important;
}
#worldTransition.world-transition.to-light,
#worldTransition.world-transition.to-dark {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Original chunky smoke mass: it expands until it hides the entire old scene. */
#worldTransition .mc-explosion-cloud {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48vmax;
  height: 48vmax;
  opacity: 0;
  transform: translate(-50%,-50%) scale(.015);
  clip-path: polygon(
    38% 0%, 62% 0%, 62% 5%, 72% 5%, 72% 11%, 82% 11%,
    82% 18%, 91% 18%, 91% 29%, 97% 29%, 97% 42%, 100% 42%,
    100% 63%, 95% 63%, 95% 76%, 87% 76%, 87% 87%, 74% 87%,
    74% 95%, 60% 95%, 60% 100%, 37% 100%, 37% 95%,
    23% 95%, 23% 88%, 12% 88%, 12% 78%, 4% 78%, 4% 64%,
    0% 64%, 0% 42%, 5% 42%, 5% 29%, 12% 29%, 12% 18%,
    23% 18%, 23% 10%, 36% 10%, 36% 5%, 38% 5%
  );
  filter: drop-shadow(0 0 10px rgba(220,225,222,.22));
  will-change: transform, opacity;
}
#worldTransition .mc-explosion-cloud::before {
  position: absolute;
  inset: 0;
  content: "";
  background-color: #d9dad8;
  background-image:
    linear-gradient(90deg,rgba(255,255,255,.94) 0 12%,transparent 12% 26%,rgba(100,105,105,.18) 26% 36%,transparent 36%),
    linear-gradient(0deg,rgba(255,255,255,.62) 0 17%,transparent 17% 46%,rgba(90,95,95,.18) 46% 57%,transparent 57%),
    repeating-linear-gradient(0deg,rgba(255,255,255,.2) 0 7px,rgba(100,105,105,.08) 7px 12px,transparent 12px 20px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.16) 0 8px,rgba(65,72,75,.1) 8px 12px,transparent 12px 23px),
    linear-gradient(145deg,#f7f7f4 0%,#d5d7d5 36%,#aeb2b1 65%,#f1f1ed 100%);
  background-size: 100% 100%,100% 100%,24px 24px,24px 24px,100% 100%;
  image-rendering: pixelated;
}
#worldTransition .mc-explosion-cloud::after {
  position: absolute;
  inset: 8%;
  content: "";
  opacity: .56;
  background:
    linear-gradient(90deg,transparent 0 18%,rgba(255,255,255,.85) 18% 29%,transparent 29% 62%,rgba(70,74,75,.25) 62% 70%,transparent 70%),
    repeating-linear-gradient(135deg,transparent 0 19px,rgba(255,255,255,.36) 19px 28px,transparent 28px 43px);
  clip-path: polygon(0 22%,18% 22%,18% 0,41% 0,41% 18%,66% 18%,66% 0,100% 0,100% 74%,82% 74%,82% 100%,52% 100%,52% 82%,20% 82%,20% 100%,0 100%);
}
#worldTransition .mc-explosion-cloud--back {
  width: 56vmax;
  height: 56vmax;
  z-index: 1;
  filter: drop-shadow(0 0 18px rgba(255,255,255,.28));
}
#worldTransition .mc-explosion-cloud--mid {
  width: 45vmax;
  height: 45vmax;
  z-index: 2;
  transform: translate(-50%,-50%) scale(.01) rotate(13deg);
}
#worldTransition .mc-explosion-cloud--core {
  width: 32vmax;
  height: 32vmax;
  z-index: 3;
  transform: translate(-50%,-50%) scale(.01) rotate(-8deg);
}
#worldTransition.to-light .mc-explosion-cloud--back {
  animation: mc-smoke-wall-back 2.05s cubic-bezier(.12,.7,.2,1) both;
}
#worldTransition.to-light .mc-explosion-cloud--mid {
  animation: mc-smoke-wall-mid 1.82s cubic-bezier(.12,.7,.2,1) 70ms both;
}
#worldTransition.to-light .mc-explosion-cloud--core {
  animation: mc-smoke-wall-core 1.56s cubic-bezier(.12,.7,.2,1) 110ms both;
}
@keyframes mc-smoke-wall-back {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.015) rotate(-12deg); }
  13% { opacity: 1; }
  44% { opacity: 1; transform: translate(-50%,-50%) scale(2.85) rotate(5deg); }
  69% { opacity: .98; transform: translate(-50%,-50%) scale(3.8) rotate(11deg); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(4.25) rotate(18deg); }
}
@keyframes mc-smoke-wall-mid {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.01) rotate(13deg); }
  12% { opacity: 1; }
  42% { opacity: 1; transform: translate(-50%,-50%) scale(3.05) rotate(27deg); }
  68% { opacity: .96; transform: translate(-50%,-50%) scale(4.1) rotate(35deg); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(4.65) rotate(42deg); }
}
@keyframes mc-smoke-wall-core {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.01) rotate(-8deg); }
  12% { opacity: 1; }
  38% { opacity: .98; transform: translate(-50%,-50%) scale(3.5) rotate(7deg); }
  62% { opacity: .9; transform: translate(-50%,-50%) scale(4.7) rotate(15deg); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(5.3) rotate(22deg); }
}
#worldTransition.to-light .transition-flash {
  z-index: 7;
  background:
    radial-gradient(circle at 50% 50%,rgba(255,255,255,.98) 0 3%,rgba(250,250,247,.9) 9%,rgba(222,225,222,.58) 22%,transparent 54%) !important;
  animation: mc-smoke-flash 1.1s ease-out both !important;
}
@keyframes mc-smoke-flash {
  0% { opacity: 0; transform: scale(.15); }
  13% { opacity: .98; transform: scale(.95); }
  48% { opacity: .7; transform: scale(2.5); }
  100% { opacity: 0; transform: scale(3.6); }
}
#worldTransition.to-light .transition-particles {
  z-index: 8;
}
#worldTransition.to-light .transition-particles i {
  animation: mc-smoke-particle 1.9s cubic-bezier(.1,.58,.18,1) var(--dust-delay,0ms) both !important;
}
#worldTransition.to-light .transition-blocks {
  z-index: 9;
}
#worldTransition.to-light .transition-blocks i {
  animation: mc-block-fragment 1.72s cubic-bezier(.12,.66,.22,1) var(--fragment-delay,0ms) both !important;
}
#worldTransition.to-light .transition-rings {
  z-index: 6;
  border-color: rgba(248,249,246,.82) !important;
  box-shadow: 0 0 22px 9px rgba(236,239,235,.75),inset 0 0 18px rgba(255,255,255,.8),0 0 80px rgba(168,174,171,.42) !important;
  animation: forest-shockwave 1.42s cubic-bezier(.12,.7,.2,1) both !important;
}

/* The overlay is between scenery and UI: it covers the background, never the book or text. */
#worldTransition.to-light { visibility: visible !important; opacity: 1 !important; }
#worldTransition.to-dark .transition-glow,
#worldTransition.to-dark .transition-blocks,
#worldTransition.to-dark .transition-particles,
#worldTransition.to-dark .mc-explosion-cloud { display: none !important; }
#worldTransition.to-dark .transition-flash {
  z-index: 15;
  background:
    radial-gradient(ellipse 24% 34% at 7% 72%,rgba(255,156,69,.47),transparent 74%),
    radial-gradient(ellipse 22% 32% at 93% 67%,rgba(255,156,69,.4),transparent 74%) !important;
  animation: torch-awake 1.5s ease-out 1.05s both !important;
}

/* Fix every input and label on the book; dark mode must not inherit green form styles. */
:root[data-theme="dark"] #auth .book-form label {
  color: #806549 !important;
  text-shadow: 1px 1px 0 rgba(255,255,255,.2);
}
:root[data-theme="dark"] #auth .book-form input,
:root[data-theme="dark"] #auth .book-form input[type="text"],
:root[data-theme="dark"] #auth .book-form input[type="email"],
:root[data-theme="dark"] #auth .book-form input[type="password"] {
  border: 2px solid #777b77 !important;
  border-radius: 0 !important;
  color: #eee9dc !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.055),transparent 42%),
    linear-gradient(180deg,#454b4d,#303639) !important;
  box-shadow:
    inset 0 3px 5px rgba(0,0,0,.5),
    inset 1px 1px 0 rgba(255,255,255,.08),
    0 3px 0 rgba(0,0,0,.28) !important;
  caret-color: #edc47d;
}
:root[data-theme="dark"] #auth .book-form input::placeholder {
  color: #b8b6ad !important;
  opacity: 1;
}
:root[data-theme="dark"] #auth .book-form input:focus {
  border-color: #c49a61 !important;
  box-shadow:
    inset 0 3px 5px rgba(0,0,0,.42),
    0 0 0 3px rgba(196,154,97,.22) !important;
}
:root[data-theme="dark"] #auth .book-form .form-error {
  color: #9c3d31 !important;
}
@media (prefers-reduced-motion: reduce) {
  #worldTransition.to-light .mc-explosion-cloud,
  #worldTransition.to-light .transition-particles i,
  #worldTransition.to-light .transition-blocks i {
    animation-duration: .8s !important;
  }
}


/* Full-viewport Minecraft smoke transition canvas */
#worldTransition.world-transition {
  position: absolute !important;
  z-index: 40 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  pointer-events: none !important;
  background: transparent !important;
  contain: strict;
}
#mcExplosionCanvas {
  position: absolute !important;
  z-index: 20 !important;
  inset: 0 !important;
  display: none;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated;
  pointer-events: none;
}
#worldTransition.to-light #mcExplosionCanvas {
  display: block !important;
}
#worldTransition.to-dark #mcExplosionCanvas {
  display: none !important;
}
#worldTransition.to-light .transition-flash {
  display: none !important;
}
#worldTransition.to-dark .transition-flash {
  position: absolute;
  z-index: 21;
  inset: 0;
  display: block !important;
  opacity: 0;
  background:
    radial-gradient(ellipse 24% 34% at 7% 72%,rgba(255,156,69,.48),transparent 74%),
    radial-gradient(ellipse 22% 32% at 93% 67%,rgba(255,156,69,.4),transparent 74%) !important;
  mix-blend-mode: screen;
  filter: blur(12px);
  animation: torch-awake 1.5s ease-out 1.05s both !important;
}

/* Stone-grey fields on BOTH pages of the book in dark mode. */
:root[data-theme="dark"] #auth .book-page .book-form input,
:root[data-theme="dark"] #auth .book-page .book-form input[type="email"],
:root[data-theme="dark"] #auth .book-page .book-form input[type="password"],
:root[data-theme="dark"] #auth .book-page .book-form input[type="text"] {
  border: 2px solid #626d72 !important;
  color: #f1f0e9 !important;
  background: linear-gradient(180deg,#3b4449 0%,#293136 100%) !important;
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,.54),
    inset 1px 1px 0 rgba(255,255,255,.08),
    0 2px 0 rgba(0,0,0,.35) !important;
  caret-color: #f2cc82;
}
:root[data-theme="dark"] #auth .book-page .book-form input::placeholder {
  color: #adb6b8 !important;
  opacity: 1;
}
:root[data-theme="dark"] #auth .book-page .book-form input:focus {
  border-color: #c09661 !important;
  background: linear-gradient(180deg,#424b50 0%,#2d363b 100%) !important;
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,.46),
    0 0 0 3px rgba(192,150,97,.22) !important;
}
:root[data-theme="dark"] #auth .book-page .book-form label {
  color: #78634c !important;
}
:root[data-theme="dark"] #auth .book-page .book-form label .muted {
  color: #98836b !important;
}
:root[data-theme="dark"] #auth .book-page .book-form .form-error {
  color: #9e463a !important;
}
:root[data-theme="dark"] #auth .book-page .code-info {
  color: #75634e !important;
}


/* Bottom-up stone-cube cave assembly using the uploaded stone texture. */
.mc-cave-canvas {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  image-rendering: pixelated;
  pointer-events: none;
  transition: opacity .52s ease;
}
.world-scenery.is-building-cave .mc-cave-canvas,
.world-scenery.is-cave-built .mc-cave-canvas { opacity: 1; }
.world-scenery.is-leaving-cave .mc-cave-canvas { opacity: 0; }
.world-scenery.is-building-cave .world-layer--cave,
.world-scenery.is-cave-built .world-layer--cave,
.world-scenery.is-cave-built .world-layer--surface { opacity: 0 !important; }
.world-scenery.is-building-cave .world-layer--surface {
  opacity: 1 !important;
  filter: brightness(.78) saturate(.78) contrast(1.08);
}
.world-scenery.is-leaving-cave .world-layer--surface { opacity: 1 !important; }
.world-scenery.is-leaving-cave .world-layer--cave { opacity: 0 !important; }
.world-cave-shade {
  z-index: 6 !important;
}
.world-scenery.is-building-cave .world-cave-shade {
  opacity: 0;
  animation: stone-scene-darken 1.75s linear both !important;
}
.world-scenery.is-cave-built .world-cave-shade { opacity: .18 !important; }
.world-torch-glow { z-index: 7 !important; }
.world-scenery.is-building-cave .world-torch-glow {
  opacity: 0;
  animation: stone-torches-ignite 1.05s ease-out 1.25s both !important;
}
.world-scenery.is-cave-built .world-torch-glow {
  opacity: .64 !important;
  animation: stone-torch-flicker 3.4s steps(5,end) infinite alternate;
}
@keyframes stone-scene-darken {
  0% { opacity: 0; }
  25% { opacity: .13; }
  100% { opacity: .7; }
}
@keyframes stone-torches-ignite {
  0% { opacity: 0; filter: blur(22px); }
  48% { opacity: .95; filter: blur(9px); }
  100% { opacity: .62; filter: blur(13px); }
}
@keyframes stone-torch-flicker {
  0% { opacity: .48; filter: blur(14px); }
  100% { opacity: .72; filter: blur(10px); }
}

/* The explosion canvas is crisp pixel debris, not a blurred expanding cloud. */
#worldTransition.to-light .transition-flash {
  z-index: 30 !important;
  display: none !important;
}
#worldTransition.to-light #mcExplosionCanvas {
  display: block !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#worldTransition.to-dark #mcExplosionCanvas { display: none !important; }
#mcExplosionCanvas {
  position: absolute !important;
  z-index: 25 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  image-rendering: pixelated;
}

/* Keep the supplied stone texture and torch glow behind the book and application UI. */
.world-scenery { isolation: isolate; }
@media (prefers-reduced-motion: reduce) {
  .mc-cave-canvas { transition-duration: .01ms !important; }
  .world-scenery.is-building-cave .world-cave-shade { animation-duration: 1.75s !important; }
}


/* Minecraft book-and-quill spread: landscape pages, center binding and a real page turn. */
.auth-stage {
  position: relative;
  width: min(100%, 1000px) !important;
  gap: 14px !important;
}
.auth-book {
  width: min(900px, calc(100vw - 128px)) !important;
  height: min(520px, calc(100svh - 172px)) !important;
  min-height: 410px !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 7px solid #4b2c1b !important;
  border-radius: 9px !important;
  background:
    repeating-linear-gradient(7deg,rgba(255,221,160,.045) 0 2px,transparent 2px 9px),
    linear-gradient(90deg,#29170f 0%,#805033 3%,#5a3824 8%,#75482d 50%,#5c3925 92%,#301b12 100%) !important;
  box-shadow:
    0 7px 0 #21140e,
    0 0 0 2px rgba(221,177,119,.42),
    0 25px 58px rgba(0,0,0,.6),
    inset 0 0 0 2px rgba(231,184,122,.23) !important;
  transform: none !important;
}
.auth-book::before {
  inset: 4px !important;
  z-index: 7 !important;
  width: auto !important;
  border: 1px solid rgba(227,184,128,.45) !important;
  border-radius: 4px !important;
  background:
    linear-gradient(90deg,rgba(25,13,8,.24),transparent 4%,transparent 96%,rgba(25,13,8,.24)),
    repeating-linear-gradient(0deg,rgba(57,31,18,.08) 0 3px,transparent 3px 10px) !important;
}
.auth-book::after {
  top: 7px !important;
  bottom: 7px !important;
  left: 50% !important;
  z-index: 8 !important;
  width: 12px !important;
  transform: translateX(-50%);
  background: linear-gradient(90deg,#73513a 0%,#d0b18a 18%,#6f4a30 44%,#392319 55%,#c3a27a 80%,#68432c 100%) !important;
  box-shadow: 0 0 9px rgba(52,31,19,.55), inset 2px 0 2px rgba(255,240,205,.35), inset -2px 0 3px rgba(0,0,0,.5) !important;
}
.book-cover-spine { display: none !important; }
.book-page-stack {
  inset: 9px !important;
  z-index: 1 !important;
  border: 1px solid #8a6949 !important;
  border-radius: 4px !important;
  background: repeating-linear-gradient(180deg,#e9dec5 0 2px,#c9b797 2px 3px) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.32), 0 4px 0 rgba(0,0,0,.23) !important;
}
.book-right-underlay {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  bottom: 14px;
  left: calc(50% + 8px);
  display: flex;
  justify-content: center;
  padding-top: 12px;
  border: 1px solid #c7b38d;
  color: #75664f;
  background:
    repeating-linear-gradient(0deg,rgba(120,91,53,.025) 0 1px,transparent 1px 5px),
    linear-gradient(110deg,#f7f1df,#f4ecd6 62%,#e8dcc2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.48), inset -5px 0 12px rgba(107,67,35,.11);
  font: 10px/1.4 var(--mc-font);
}
.book-right-underlay b {
  position: absolute;
  top: 48%;
  right: 10px;
  color: #8d8069;
  font: 24px/1 var(--mc-font);
  font-weight: 400;
}
.book-leaf {
  inset: 13px !important;
  z-index: 3 !important;
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
  gap: 0 !important;
  transform: none !important;
  transform-style: flat !important;
  transition: none !important;
}
.auth-book.is-page-2 .book-leaf { transform: none !important; }
.book-page {
  position: relative !important;
  inset: auto !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 20px 28px 17px !important;
  overflow: hidden !important;
  border: 1px solid rgba(167,143,108,.7) !important;
  border-radius: 1px !important;
  color: #3c2b1e !important;
  background:
    repeating-linear-gradient(90deg,rgba(120,91,53,.025) 0 1px,transparent 1px 5px),
    repeating-linear-gradient(0deg,rgba(120,91,53,.025) 0 1px,transparent 1px 6px),
    linear-gradient(135deg,#fff9e9 0%,#f4ecd8 60%,#e8dcc2 100%) !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.38), inset 4px 0 12px rgba(103,72,39,.09) !important;
}
.book-page::before, .book-page::after { content: none !important; display: none !important; }
.book-page--front {
  grid-column: 1;
  z-index: 4;
  border-right: 1px solid rgba(103,76,49,.32) !important;
}
.book-page--back {
  grid-column: 2;
  z-index: 5;
  transform: rotateY(-180deg) !important;
  transform-origin: left center !important;
  backface-visibility: hidden !important;
  transition: transform .62s cubic-bezier(.2,.72,.18,1) !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.38), -5px 0 12px rgba(67,43,25,.11) !important;
}
.auth-book.is-page-2 .book-page--back {
  transform: rotateY(0deg) !important;
}
.book-page-top {
  justify-content: center !important;
  margin: 0 0 17px !important;
  padding: 0 0 7px !important;
  border: 0 !important;
  color: #75664f !important;
  font: 10px/1.4 var(--mc-font) !important;
  text-align: center !important;
}
.book-chapter { display: none !important; }
.page-counter {
  color: #76664f !important;
  font: 10px/1.4 var(--mc-font) !important;
  text-align: center !important;
}
.book-content {
  gap: 0 !important;
  align-items: stretch !important;
}
.book-insignia, .book-kicker { display: none !important; }
.book-title {
  margin: 3px 0 7px !important;
  color: #3b2b1e !important;
  font: 16px/1.45 var(--mc-font) !important;
  letter-spacing: 0 !important;
  text-shadow: 1px 1px 0 rgba(95,68,39,.12) !important;
}
.book-subtitle {
  margin: 0 0 12px !important;
  color: #806e56 !important;
  font: 10px/1.55 var(--mc-font) !important;
}
.book-form { margin: 0 !important; }
.book-form label {
  margin: 8px 0 4px !important;
  color: #574633 !important;
  font: 10px/1.35 var(--mc-font) !important;
  text-transform: none !important;
}
.book-form input {
  min-height: 33px !important;
  margin: 0 0 4px !important;
  padding: 6px 8px !important;
  border: 1px solid #b8a789 !important;
  border-radius: 0 !important;
  color: #33271e !important;
  background: #fffdf4 !important;
  box-shadow: inset 0 1px 3px rgba(66,46,25,.1), 0 1px 0 rgba(255,255,255,.55) !important;
  font: 10px/1.4 var(--mc-font) !important;
}
.book-form input:focus {
  border-color: #927047 !important;
  box-shadow: inset 0 1px 3px rgba(66,46,25,.1), 0 0 0 2px rgba(149,112,75,.16) !important;
}
.book-form input::placeholder { color: #a99b83 !important; }
.book-form .form-error { min-height: 14px !important; margin: 3px 0 0 !important; font-size: 9px !important; }
.book-page-link, .book-inline-link {
  align-self: flex-start !important;
  margin-top: 9px !important;
  padding: 3px 0 !important;
  color: #785438 !important;
  background: transparent !important;
  font: 10px/1.45 var(--mc-font) !important;
  text-align: left !important;
}
.book-page-link:hover, .book-inline-link:hover { color: #a04c32 !important; text-decoration: underline !important; }
.book-page-link--guest { margin-top: 3px !important; color: #8a806e !important; }
.book-content--registration .book-insignia { display: none !important; }
.book-content--registration .book-title { font-size: 15px !important; }
.book-content--registration .book-subtitle { margin-bottom: 7px !important; }
.book-content--registration .book-form label { margin-top: 4px !important; font-size: 9px !important; }
.book-content--registration .book-form input { min-height: 29px !important; margin-bottom: 2px !important; padding: 4px 7px !important; font-size: 9px !important; }
.book-content--registration .form-error { min-height: 12px !important; margin: 2px 0 !important; }
#backToLogin {
  position: absolute !important;
  top: 2px !important;
  right: 1px !important;
  z-index: 9 !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #79694f !important;
  font: 18px/1 var(--mc-font) !important;
  text-align: center !important;
}
.book-bottom-mark { display: none !important; }
.book-actions {
  width: 180px !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
}
.book-action-button {
  min-height: 40px !important;
  border: 2px solid #77756f !important;
  border-radius: 0 !important;
  color: #242522 !important;
  background: linear-gradient(#e5e5e2,#c6c7c4) !important;
  box-shadow: 0 3px 0 #74746f, inset 1px 1px 0 rgba(255,255,255,.9), inset -1px -1px 0 rgba(90,90,86,.3) !important;
  font: 11px/1.4 var(--mc-font) !important;
  text-shadow: 1px 1px 0 rgba(255,255,255,.45) !important;
}
.book-action-button:hover { filter: brightness(1.05); }
.book-quill {
  top: auto !important;
  right: -66px !important;
  bottom: -24px !important;
  width: 82px !important;
  height: 235px !important;
  z-index: 1 !important;
  transform: rotate(14deg) !important;
  opacity: .96;
}
:root[data-theme="dark"] #auth .book-page .book-form input {
  border: 2px solid #626d72 !important;
  color: #f1f0e9 !important;
  background: linear-gradient(180deg,#3b4449 0%,#293136 100%) !important;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.54), inset 1px 1px 0 rgba(255,255,255,.08), 0 2px 0 rgba(0,0,0,.35) !important;
  caret-color: #f2cc82;
}
:root[data-theme="dark"] #auth .book-page .book-form input::placeholder { color: #adb6b8 !important; }
:root[data-theme="dark"] #auth .book-page .book-form label { color: #78634c !important; }

@media (max-width: 760px) {
  .auth-screen { padding: 42px 10px 22px !important; }
  .auth-stage { width: 100% !important; gap: 13px !important; }
  .auth-book {
    width: calc(100vw - 28px) !important;
    height: min(560px, calc(100svh - 160px)) !important;
    min-height: 455px !important;
  }
  .book-leaf { inset: 11px !important; }
  .book-page { padding: 16px 10px 13px !important; }
  .book-page-top { margin-bottom: 12px !important; }
  .book-title { font-size: 12px !important; }
  .book-subtitle { font-size: 8px !important; }
  .book-form label { font-size: 8px !important; }
  .book-form input { min-height: 29px !important; padding: 4px 5px !important; font-size: 8px !important; }
  .book-content--registration .book-form label { font-size: 8px !important; }
  .book-content--registration .book-form input { min-height: 26px !important; font-size: 8px !important; }
  .book-quill { right: -14px !important; bottom: -12px !important; width: 48px !important; height: 156px !important; opacity: .82; }
  .book-right-underlay { right: 11px; top: 12px; bottom: 12px; left: calc(50% + 6px); }
}
@media (max-width: 380px) {
  .book-page { padding-left: 7px !important; padding-right: 7px !important; }
  .book-form input { font-size: 7px !important; }
  .book-content--registration .book-form input { font-size: 7px !important; }
}

/* Lightweight center-only Minecraft fracture: keep the environment visible around it. */
#worldTransition.to-light::before,
#worldTransition.to-light::after { content: none !important; display: none !important; animation: none !important; }
#worldTransition.to-light .transition-flash { display: none !important; animation: none !important; }
#worldTransition.to-light #mcExplosionCanvas {
  display: block !important;
  position: absolute !important;
  inset: auto !important;
  top: 0 !important;
  left: 50% !important;
  right: auto !important;
  width: min(560px,82vw) !important;
  height: 100% !important;
  transform: translateX(-50%) !important;
  image-rendering: pixelated !important;
}
#worldTransition.to-dark #mcExplosionCanvas { display: none !important; }
#worldTransition.to-light { background: transparent !important; }


/* Torch light is now rendered locally by the cave canvas at the actual block positions. */
.world-torch-glow { display: none !important; }
.mc-cave-canvas { image-rendering: pixelated; }


/* Minecraft-style explosion: compact square sprite burst, never a vertical rift. */
#worldTransition.to-light::before,
#worldTransition.to-light::after {
  content: none !important;
  display: none !important;
  animation: none !important;
}
#worldTransition.to-light .transition-flash { display: none !important; animation: none !important; }
#worldTransition.to-light #mcExplosionCanvas {
  display: block !important;
  position: absolute !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: min(520px,78vmin) !important;
  height: min(520px,78vmin) !important;
  transform: translate(-50%,-50%) !important;
  image-rendering: pixelated !important;
}
#worldTransition.to-dark #mcExplosionCanvas { display: none !important; }
#worldTransition.to-light { background: transparent !important; }


/* Neutral achievement-frame palette for the entire light theme. */
:root:not([data-theme="dark"]) {
  color-scheme: light;
  --page: #dedede;
  --surface: #ededed;
  --surface2: #d2d2d2;
  --text: #242424;
  --muted: #5f5f5f;
  --border: #686868;
  --accent: #858585;
  --accent2: #303030;
  --accent-soft: #c8c8c8;
  --button: #bdbdbd;
  --button-hover: #cecece;
  --shadow: 0 3px 0 rgba(30,30,30,.38), 0 8px 18px rgba(0,0,0,.12);
  --stone-frame-fill: #c4c4c4;
  --stone-frame-outline: #111111;
  --stone-frame-light: #f2f2f2;
  --stone-frame-shadow: #5a5a5a;
}

/* Every editable field uses the unfinished grey achievement frame from the reference. */
:root:not([data-theme="dark"]) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
:root:not([data-theme="dark"]) select,
:root:not([data-theme="dark"]) textarea,
:root:not([data-theme="dark"]) [contenteditable="true"] {
  min-height: 40px;
  border: 3px solid var(--stone-frame-outline) !important;
  border-radius: 0 !important;
  color: #222222 !important;
  background-color: var(--stone-frame-fill) !important;
  background-image: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.025)) !important;
  box-shadow:
    inset 2px 2px 0 var(--stone-frame-light),
    inset -2px -2px 0 #777777,
    3px 3px 0 var(--stone-frame-shadow) !important;
  outline: none;
  caret-color: #171717;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px),
    calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px),
    0 calc(100% - 4px)
  ) !important;
  transition: background-color .12s steps(2,end), box-shadow .12s steps(2,end) !important;
}

:root:not([data-theme="dark"]) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus,
:root:not([data-theme="dark"]) select:focus,
:root:not([data-theme="dark"]) textarea:focus,
:root:not([data-theme="dark"]) [contenteditable="true"]:focus {
  border-color: #000000 !important;
  background-color: #cecece !important;
  box-shadow:
    inset 2px 2px 0 #ffffff,
    inset -2px -2px 0 #707070,
    3px 3px 0 #3e3e3e,
    0 0 0 2px #aaaaaa !important;
}

:root:not([data-theme="dark"]) input::placeholder,
:root:not([data-theme="dark"]) textarea::placeholder {
  color: #666666 !important;
  opacity: 1;
}

:root:not([data-theme="dark"]) select {
  appearance: none;
  padding-right: 32px !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #171717 50%),
    linear-gradient(135deg, #171717 50%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.025)) !important;
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 10px) 17px,
    0 0 !important;
  background-size: 6px 6px, 6px 6px, 100% 100% !important;
  background-repeat: no-repeat !important;
}

:root:not([data-theme="dark"]) input[type="checkbox"],
:root:not([data-theme="dark"]) input[type="radio"] {
  appearance: none;
  display: inline-grid;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0 7px 0 0;
  vertical-align: middle;
  place-content: center;
  border: 3px solid #111111 !important;
  border-radius: 0 !important;
  background: #c4c4c4 !important;
  box-shadow: inset 2px 2px 0 #f2f2f2, inset -2px -2px 0 #777777, 2px 2px 0 #5a5a5a !important;
  clip-path: none !important;
}
:root:not([data-theme="dark"]) input[type="checkbox"]:checked,
:root:not([data-theme="dark"]) input[type="radio"]:checked {
  background: #777777 !important;
  box-shadow: inset 2px 2px 0 #d7d7d7, inset -2px -2px 0 #393939, 2px 2px 0 #5a5a5a !important;
}
:root:not([data-theme="dark"]) input[type="checkbox"]:checked::after {
  content: "✓";
  color: #ffffff;
  font: 700 13px/1 Arial,sans-serif;
  text-shadow: 1px 1px #222222;
}
:root:not([data-theme="dark"]) input[type="radio"] {
  border-radius: 0 !important;
}
:root:not([data-theme="dark"]) input[type="radio"]:checked::after {
  content: "";
  width: 7px;
  height: 7px;
  background: #171717;
}

:root:not([data-theme="dark"]) .demo-form,
:root:not([data-theme="dark"]) .demo-card,
:root:not([data-theme="dark"]) .demo-stat,
:root:not([data-theme="dark"]) .match-box,
:root:not([data-theme="dark"]) .chat-box,
:root:not([data-theme="dark"]) .more-menu,
:root:not([data-theme="dark"]) .more-btn,
:root:not([data-theme="dark"]) .theme-btn,
:root:not([data-theme="dark"]) .filter-row,
:root:not([data-theme="dark"]) .topbar {
  border-color: #4b4b4b !important;
  border-radius: 0 !important;
}

:root:not([data-theme="dark"]) .demo-card,
:root:not([data-theme="dark"]) .demo-stat,
:root:not([data-theme="dark"]) .demo-form,
:root:not([data-theme="dark"]) .match-box,
:root:not([data-theme="dark"]) .chat-box,
:root:not([data-theme="dark"]) .more-menu {
  background-color: #e2e2e2 !important;
  box-shadow: 3px 3px 0 #777777, inset 2px 2px 0 rgba(255,255,255,.7) !important;
}

:root:not([data-theme="dark"]) .demo-form label,
:root:not([data-theme="dark"]) .auth-form label,
:root:not([data-theme="dark"]) .data-row,
:root:not([data-theme="dark"]) .eyebrow,
:root:not([data-theme="dark"]) a,
:root:not([data-theme="dark"]) .text-button {
  color: #333333 !important;
}

:root:not([data-theme="dark"]) .plus { color: #333333 !important; }
:root:not([data-theme="dark"]) .minus { color: #555555 !important; }
:root:not([data-theme="dark"]) .rate-bars span { background: #8b8b8b !important; }
:root:not([data-theme="dark"]) .brand-mark {
  border-color: #171717 !important;
  color: #ffffff !important;
  background: linear-gradient(180deg,#bdbdbd 0 36%,#777777 36% 62%,#4f4f4f 62% 100%) !important;
  box-shadow: 2px 2px 0 #555555, inset 0 0 0 2px rgba(255,255,255,.25) !important;
}
:root:not([data-theme="dark"]) .toast {
  border: 3px solid #171717 !important;
  border-radius: 0 !important;
  color: #ffffff !important;
  background: #646464 !important;
  box-shadow: 3px 3px 0 #333333 !important;
}
:root:not([data-theme="dark"]) .button,
:root:not([data-theme="dark"]) .more-btn,
:root:not([data-theme="dark"]) .theme-btn {
  border-color: #191919 !important;
  color: #242424 !important;
  border-radius: 0 !important;
  background: linear-gradient(#d6d6d6,#a9a9a9) !important;
  box-shadow: 0 3px 0 #555555, inset 2px 2px 0 rgba(255,255,255,.8), inset -2px -2px 0 rgba(0,0,0,.18) !important;
}
:root:not([data-theme="dark"]) .button-primary {
  color: #181818 !important;
  background: linear-gradient(#cfcfcf,#a2a2a2) !important;
}
:root:not([data-theme="dark"]) .button:hover,
:root:not([data-theme="dark"]) .more-btn:hover,
:root:not([data-theme="dark"]) .theme-btn:hover { filter: brightness(1.06); }
:root:not([data-theme="dark"]) .button:active {
  box-shadow: 0 1px 0 #555555, inset 2px 2px 0 rgba(0,0,0,.12) !important;
}

/* Dark cave palette remains intentionally separate. */


/* Direct light-mode selectors: force the grey unfinished-achievement frame. */
html[data-theme="light"] body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
html[data-theme="light"] body select,
html[data-theme="light"] body textarea,
html[data-theme="light"] body [contenteditable="true"] {
  min-height: 40px !important;
  border: 4px solid #111111 !important;
  border-radius: 0 !important;
  color: #202020 !important;
  background-color: #c4c4c4 !important;
  background-image: linear-gradient(180deg,rgba(255,255,255,.10),rgba(0,0,0,.04)) !important;
  box-shadow: inset 3px 3px 0 #f2f2f2, inset -3px -3px 0 #5a5a5a !important;
  clip-path: polygon(
    6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,100% 3px,
    100% calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),
    calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),0 calc(100% - 3px),
    0 3px,6px 3px
  ) !important;
}
html[data-theme="light"] body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus,
html[data-theme="light"] body select:focus,
html[data-theme="light"] body textarea:focus,
html[data-theme="light"] body [contenteditable="true"]:focus {
  background-color: #cecece !important;
  box-shadow: inset 3px 3px 0 #ffffff, inset -3px -3px 0 #4d4d4d, 0 0 0 2px #333333 !important;
}
html[data-theme="light"] body input::placeholder,
html[data-theme="light"] body textarea::placeholder {
  color: #666666 !important;
  opacity: 1 !important;
}
html[data-theme="light"] body select {
  appearance: none !important;
  padding-right: 30px !important;
  background-image:
    linear-gradient(45deg,transparent 50%,#111 50%),
    linear-gradient(135deg,#111 50%,transparent 50%),
    linear-gradient(180deg,rgba(255,255,255,.10),rgba(0,0,0,.04)) !important;
  background-position: calc(100% - 15px) 16px,calc(100% - 9px) 16px,0 0 !important;
  background-size: 6px 6px,6px 6px,100% 100% !important;
  background-repeat: no-repeat !important;
}
html[data-theme="light"] body input[type="checkbox"],
html[data-theme="light"] body input[type="radio"] {
  appearance: none !important;
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  border: 3px solid #111 !important;
  border-radius: 0 !important;
  background: #c4c4c4 !important;
  box-shadow: inset 2px 2px 0 #f2f2f2,inset -2px -2px 0 #5a5a5a !important;
  clip-path: none !important;
}
html[data-theme="light"] body input[type="checkbox"]:checked,
html[data-theme="light"] body input[type="radio"]:checked {
  background: #8d8d8d !important;
}

/* Remove all legacy amber light sources; only the three sprites on the blocks may glow. */
html[data-world="cave"] .world-light-shafts {
  opacity: .025 !important;
  background: linear-gradient(180deg,rgba(4,9,15,.18),transparent 55%,rgba(5,9,14,.32)) !important;
  mix-blend-mode: normal !important;
}
html[data-world="cave"] .world-particles { display: none !important; opacity: 0 !important; }
.world-torch-glow {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  background: none !important;
  animation: none !important;
  filter: none !important;
}
#worldTransition.to-dark .transition-flash,
.world-transition.to-dark .transition-flash {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  background: none !important;
  animation: none !important;
}


/* Three-page Minecraft book: one portrait page first, then pages 2–3 side by side. */
.auth-stage {
  width: min(100%, 1040px) !important;
  justify-items: center !important;
  gap: 14px !important;
}
.auth-book {
  width: min(470px, calc(100vw - 44px)) !important;
  height: min(590px, calc(100svh - 178px)) !important;
  min-height: 450px !important;
  position: relative !important;
  overflow: visible !important;
  padding: 0 !important;
  border: 7px solid #4b2c1b !important;
  border-radius: 9px !important;
  background:
    repeating-linear-gradient(7deg,rgba(255,221,160,.045) 0 2px,transparent 2px 9px),
    linear-gradient(90deg,#29170f 0%,#805033 3%,#5a3824 8%,#75482d 50%,#5c3925 92%,#301b12 100%) !important;
  box-shadow: 0 7px 0 #21140e,0 0 0 2px rgba(221,177,119,.42),0 25px 58px rgba(0,0,0,.6),inset 0 0 0 2px rgba(231,184,122,.23) !important;
  transform-style: preserve-3d !important;
  transition: width .62s cubic-bezier(.2,.72,.18,1),height .62s cubic-bezier(.2,.72,.18,1),box-shadow .4s ease !important;
}
.auth-book::before {
  inset: 4px !important;
  z-index: 9 !important;
  width: auto !important;
  border: 1px solid rgba(227,184,128,.45) !important;
  border-radius: 4px !important;
  background: repeating-linear-gradient(0deg,rgba(57,31,18,.08) 0 3px,transparent 3px 10px) !important;
  pointer-events: none !important;
}
.auth-book::after {
  opacity: 0 !important;
  pointer-events: none !important;
}
.auth-book.is-spread {
  width: min(960px, calc(100vw - 70px)) !important;
  height: min(590px, calc(100svh - 178px)) !important;
}
.auth-book.is-spread::after {
  opacity: 1 !important;
  top: 7px !important;
  bottom: 7px !important;
  left: 50% !important;
  z-index: 10 !important;
  width: 12px !important;
  transform: translateX(-50%) !important;
  background: linear-gradient(90deg,#73513a 0%,#d0b18a 18%,#6f4a30 44%,#392319 55%,#c3a27a 80%,#68432c 100%) !important;
  box-shadow: 0 0 9px rgba(52,31,19,.55),inset 2px 0 2px rgba(255,240,205,.35),inset -2px 0 3px rgba(0,0,0,.5) !important;
}
.book-page-stack {
  inset: 9px !important;
  z-index: 1 !important;
  border: 1px solid #8a6949 !important;
  border-radius: 4px !important;
  background: repeating-linear-gradient(180deg,#e9dec5 0 2px,#c9b797 2px 3px) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.32),0 4px 0 rgba(0,0,0,.23) !important;
}
.book-page {
  color: #3c2b1e !important;
  border: 1px solid rgba(167,143,108,.7) !important;
  border-radius: 1px !important;
  background:
    repeating-linear-gradient(90deg,rgba(120,91,53,.025) 0 1px,transparent 1px 5px),
    repeating-linear-gradient(0deg,rgba(120,91,53,.025) 0 1px,transparent 1px 6px),
    linear-gradient(135deg,#fff9e9 0%,#f4ecd8 60%,#e8dcc2 100%) !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.38),inset 4px 0 12px rgba(103,72,39,.09) !important;
  overflow: hidden !important;
}
.book-page::before,.book-page::after { content: none !important; display:none !important; }
.book-page-top {
  display: flex !important;
  justify-content: flex-end !important;
  margin: 0 0 30px !important;
  padding: 0 !important;
  border: 0 !important;
  color: #aa9478 !important;
  font: 12px/1.5 var(--mc-font) !important;
}
.page-counter { color: #aa9478 !important; font: 12px/1.5 var(--mc-font) !important; }
.book-copy { color:#3d2d20; text-align:left; }
.book-title {
  margin: 0 0 8px !important;
  color: #3d2d20 !important;
  font: 18px/1.55 var(--mc-font) !important;
  text-shadow: none !important;
}
.book-subtitle {
  margin: 0 0 23px !important;
  color: #574634 !important;
  font: 11px/1.65 var(--mc-font) !important;
}
.book-page--single {
  position: absolute !important;
  display: flex !important;
  flex-direction: column !important;
  inset: 13px !important;
  z-index: 5 !important;
  padding: 24px 32px !important;
  transform-origin: left center !important;
  transform: rotateY(0deg) !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: transform .64s cubic-bezier(.2,.72,.18,1),opacity .28s ease,visibility .28s !important;
  backface-visibility: hidden !important;
}
.auth-book.is-spread .book-page--single {
  transform: rotateY(-178deg) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.book-spread {
  position: absolute !important;
  z-index: 3 !important;
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
  gap: 0 !important;
  inset: 13px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity .24s ease .12s,visibility .24s ease .12s !important;
}
.auth-book.is-spread .book-spread {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
.book-spread .book-page {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 22px 28px 18px !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.book-page--spread-left { grid-column:1 !important; border-right:1px solid rgba(103,76,49,.32) !important; }
.book-page--spread-right { grid-column:2 !important; border-left:0 !important; }
.book-copy--registration .book-title { font-size:15px !important; }
.book-page .book-form { width:100% !important; margin:0 !important; }
.book-page .book-form label {
  display:block !important;
  margin:8px 0 4px !important;
  color:#574633 !important;
  font:10px/1.35 var(--mc-font) !important;
  text-transform:none !important;
}
.book-page .book-form input {
  width:100% !important;
  min-height:34px !important;
  margin:0 !important;
  padding:6px 8px !important;
  border:2px solid #76634e !important;
  border-radius:0 !important;
  color:#34291f !important;
  background:rgba(255,252,239,.56) !important;
  box-shadow:inset 1px 1px 0 rgba(255,255,255,.6),inset -1px -1px 0 rgba(118,99,78,.23) !important;
  font:10px/1.4 var(--mc-font) !important;
}
.book-page .book-form input:focus { border-color:#4c3a29 !important; outline:1px solid rgba(117,84,52,.32) !important; }
.book-page .book-form .form-error { min-height:13px !important; margin:3px 0 0 !important; font-size:9px !important; }
.book-page-link,.book-inline-link {
  display:inline-block !important;
  align-self:flex-start !important;
  margin:16px 0 0 !important;
  padding:3px 0 !important;
  border:0 !important;
  color:#8b7152 !important;
  background:transparent !important;
  font:10px/1.5 var(--mc-font) !important;
  text-align:left !important;
  text-decoration:underline !important;
  cursor:pointer !important;
}
.book-page-link--return { margin-top:auto !important; }
.book-close {
  position:absolute !important;
  top:9px !important;
  right:10px !important;
  border:0 !important;
  color:#493a2b !important;
  background:transparent !important;
  font:18px/1 var(--mc-font) !important;
  cursor:pointer !important;
}
.book-form--registration label { margin-top:5px !important; font-size:9px !important; }
.book-form--registration input { min-height:27px !important; padding:4px 7px !important; font-size:9px !important; }
.book-page--spread-right .book-copy { margin-bottom:4px; }
.book-page--spread-right .book-subtitle { margin-bottom:8px !important; }
.book-actions {
  display:grid !important;
  width:min(100%,360px) !important;
  grid-template-columns:1fr 1fr !important;
  gap:12px !important;
}
.book-action-button {
  min-height:39px !important;
  border:2px solid #77756f !important;
  border-radius:0 !important;
  color:#242522 !important;
  background:linear-gradient(#e5e5e2,#c6c7c4) !important;
  box-shadow:0 3px 0 #74746f,inset 1px 1px 0 rgba(255,255,255,.9),inset -1px -1px 0 rgba(90,90,86,.3) !important;
  font:11px/1.4 var(--mc-font) !important;
}
.auth-book.is-spread ~ .book-quill { right:-86px !important; }
.mc-input-shell { display:block !important; position:relative !important; width:100% !important; }
.mc-input-shell input { padding-right:24px !important; caret-color:transparent !important; }
.mc-writing-cursor {
  position:absolute !important;
  top:50% !important;
  left:8px;
  z-index:4;
  display:none;
  transform:translateY(-48%);
  color:#3d2c1d !important;
  font:inherit;
  letter-spacing:0 !important;
  line-height:1 !important;
  pointer-events:none !important;
  animation:minecraft-book-caret 1s steps(2,start) infinite !important;
}
.mc-input-shell.is-typing .mc-writing-cursor { display:block !important; }
@keyframes minecraft-book-caret { 0%,49% { opacity:1; } 50%,100% { opacity:0; } }

@media(max-width:760px) {
  .auth-screen { padding:24px 8px !important; }
  .auth-stage { width:100% !important; gap:11px !important; }
  .auth-book { width:min(440px,calc(100vw - 28px)) !important; height:min(570px,calc(100svh - 150px)) !important; min-height:430px !important; }
  .auth-book.is-spread { width:calc(100vw - 14px) !important; height:min(600px,calc(100svh - 150px)) !important; }
  .book-page--single { inset:10px !important; padding:21px 20px !important; }
  .book-spread { inset:10px !important; }
  .book-spread .book-page { padding:17px 11px 13px !important; }
  .book-page-top { margin-bottom:16px !important; font-size:9px !important; }
  .book-title { font-size:12px !important; }
  .book-subtitle { font-size:9px !important; margin-bottom:13px !important; }
  .book-page .book-form label { font-size:8px !important; margin-top:5px !important; }
  .book-page .book-form input { min-height:30px !important; font-size:8px !important; padding:4px !important; }
  .book-form--registration label { font-size:7px !important; }
  .book-form--registration input { min-height:24px !important; font-size:7px !important; padding:3px 4px !important; }
  .book-page-link,.book-inline-link { font-size:8px !important; }
  .book-quill { right:-12px !important; bottom:-10px !important; width:46px !important; height:150px !important; opacity:.8; }
}
@media(max-width:380px) {
  .book-spread .book-page { padding-left:7px !important; padding-right:7px !important; }
  .book-page .book-form input { font-size:7px !important; }
}


/* Passwordless email sign-in link on both login pages. */
.book-email-login {
  margin-top: 7px !important;
  color: #806448 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}
.book-email-login:hover { color: #4b3826 !important; }
.book-page--single .book-email-login { margin-top: 12px !important; }
@media(max-width:760px) {
  .book-email-login { font-size: 7px !important; margin-top: 4px !important; }
}


/* Only one authentication action remains: sign in or submit the active registration form. */
.book-actions {
  width: min(100%, 190px) !important;
  grid-template-columns: 1fr !important;
  justify-items: stretch !important;
}


/* Flat cave texture: exact 2D stone pixels tile the whole viewport without perspective. */
.mc-cave-canvas {
  position: absolute !important;
  z-index: 5 !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated !important;
  object-fit: fill;
  opacity: 0;
  pointer-events: none !important;
}
.world-scenery.is-building-cave .mc-cave-canvas,
.world-scenery.is-cave-built .mc-cave-canvas { opacity: 1 !important; }
.world-scenery.is-leaving-cave .mc-cave-canvas { opacity: 0 !important; }
.world-scenery.is-building-cave .world-layer--cave,
.world-scenery.is-cave-built .world-layer--cave,
.world-scenery.is-cave-built .world-layer--surface { opacity: 0 !important; }
.world-scenery.is-building-cave .world-layer--surface {
  opacity: 1 !important;
  filter: brightness(.78) saturate(.78) contrast(1.08);
}
.world-cave-shade,
.world-torch-glow { display: none !important; }
html[data-world="cave"] .world-light-shafts,
html[data-world="cave"] .world-particles { display: none !important; }


/* Cave is one uninterrupted 2D stone image, scaled to cover the entire background. */
.mc-cave-canvas {
  position: absolute !important;
  z-index: 5 !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  image-rendering: pixelated !important;
  pointer-events: none !important;
}
.world-scenery.is-building-cave .mc-cave-canvas,
.world-scenery.is-cave-built .mc-cave-canvas { opacity: 1 !important; }
.world-scenery.is-leaving-cave .mc-cave-canvas { opacity: 0 !important; }
.world-scenery.is-building-cave .world-layer--cave,
.world-scenery.is-cave-built .world-layer--cave,
.world-scenery.is-cave-built .world-layer--surface { opacity: 0 !important; }
.world-scenery.is-building-cave .world-layer--surface {
  opacity: 1 !important;
  filter: brightness(.78) saturate(.78) contrast(1.08);
}
.world-cave-build,
.world-cave-shade,
.world-torch-glow { display: none !important; }
html[data-world="cave"] .world-light-shafts,
html[data-world="cave"] .world-particles { display: none !important; }


/* The world behind the interface is now only the user's day/night surface screenshots. */
.world-layer--cave,
.world-layer--surface {
  filter: none !important;
  background-size: cover !important;
  background-position: center center !important;
}
html[data-world="cave"] .world-layer--cave { opacity: 1 !important; }
html[data-world="cave"] .world-layer--surface { opacity: 0 !important; }
html[data-world="surface"] .world-layer--cave { opacity: 0 !important; }
html[data-world="surface"] .world-layer--surface { opacity: 1 !important; }
.world-light-shafts,
.world-atmosphere,
.world-cave-shade,
.world-torch-glow,
.world-particles,
.mc-cave-canvas,
.mc-explosion-canvas,
#worldTransition { display: none !important; }


/* Uploaded photographs are normal-resolution backgrounds, never pixel-art sprites. */
html body .world-scenery,
html body .world-layer,
html body .world-layer--cave,
html body .world-layer--surface {
  image-rendering: auto !important;
  transform: none !important;
  filter: none !important;
}
html body .world-layer {
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: cover !important;
  transform: none !important;
  transition: opacity 1.15s ease !important;
}


/* The same squared pixel-frame geometry is used in both themes; the night palette is simply darker. */
html[data-theme="dark"] body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
html[data-theme="dark"] body select,
html[data-theme="dark"] body textarea,
html[data-theme="dark"] body [contenteditable="true"] {
  min-height: 40px !important;
  border: 4px solid #080b09 !important;
  border-radius: 0 !important;
  color: #f0f2e9 !important;
  background-color: #727970 !important;
  background-image: linear-gradient(180deg,rgba(255,255,255,.035),rgba(0,0,0,.18)) !important;
  box-shadow: inset 3px 3px 0 #a2a89c, inset -3px -3px 0 #292f2a !important;
  clip-path: polygon(6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,100% 3px,100% calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),0 calc(100% - 3px),0 3px,6px 3px) !important;
}
html[data-theme="dark"] body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus,
html[data-theme="dark"] body select:focus,
html[data-theme="dark"] body textarea:focus,
html[data-theme="dark"] body [contenteditable="true"]:focus {
  background-color: #81897f !important;
  box-shadow: inset 3px 3px 0 #b9bfb2, inset -3px -3px 0 #202620, 0 0 0 2px #050705 !important;
}
html[data-theme="dark"] body input::placeholder,
html[data-theme="dark"] body textarea::placeholder { color: #d0d4c9 !important; opacity: 1 !important; }
html[data-theme="dark"] body select {
  appearance: none !important;
  padding-right: 30px !important;
  background-image: linear-gradient(45deg,transparent 50%,#f0f2e9 50%),linear-gradient(135deg,#f0f2e9 50%,transparent 50%),linear-gradient(180deg,rgba(255,255,255,.035),rgba(0,0,0,.18)) !important;
  background-position: calc(100% - 15px) 16px,calc(100% - 9px) 16px,0 0 !important;
  background-size: 6px 6px,6px 6px,100% 100% !important;
  background-repeat: no-repeat !important;
}
html[data-theme="dark"] body input[type="checkbox"],
html[data-theme="dark"] body input[type="radio"] {
  appearance: none !important;
  width: 20px !important; min-width: 20px !important;
  height: 20px !important; min-height: 20px !important;
  border: 3px solid #080b09 !important; border-radius: 0 !important;
  background: #727970 !important;
  box-shadow: inset 2px 2px 0 #a2a89c,inset -2px -2px 0 #292f2a !important;
  clip-path: none !important;
}
html[data-theme="dark"] body input[type="checkbox"]:checked,
html[data-theme="dark"] body input[type="radio"]:checked { background: #525b51 !important; }

/* Dark mode turns the same book into a darker, readable leather-and-charcoal edition. */
html[data-theme="dark"] body .auth-book {
  border-color: #100b08 !important;
  background: repeating-linear-gradient(7deg,rgba(180,145,103,.018) 0 2px,transparent 2px 9px),linear-gradient(90deg,#090705 0%,#3a261a 3%,#24170f 8%,#302015 50%,#24170f 92%,#0d0806 100%) !important;
  box-shadow: 0 7px 0 #080503,0 0 0 2px rgba(95,75,53,.34),0 25px 58px rgba(0,0,0,.72),inset 0 0 0 2px rgba(164,133,94,.12) !important;
}
html[data-theme="dark"] body .auth-book::before {
  border-color: rgba(141,113,78,.24) !important;
  background: repeating-linear-gradient(0deg,rgba(12,8,5,.16) 0 3px,transparent 3px 10px) !important;
}
html[data-theme="dark"] body .auth-book.is-spread::after {
  background: linear-gradient(90deg,#34261b 0%,#766044 18%,#302117 44%,#100a07 55%,#645039 80%,#281a12 100%) !important;
  box-shadow: 0 0 9px rgba(0,0,0,.75),inset 2px 0 2px rgba(193,165,124,.12),inset -2px 0 3px rgba(0,0,0,.72) !important;
}
html[data-theme="dark"] body .book-page-stack {
  border-color: #332a20 !important;
  background: repeating-linear-gradient(180deg,#6c6251 0 2px,#383127 2px 3px) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,.62),0 4px 0 rgba(0,0,0,.5) !important;
}
html[data-theme="dark"] body .book-page {
  color: #e8ddc8 !important;
  border-color: rgba(30,24,18,.9) !important;
  background: repeating-linear-gradient(90deg,rgba(230,215,187,.018) 0 1px,transparent 1px 5px),repeating-linear-gradient(0deg,rgba(230,215,187,.016) 0 1px,transparent 1px 6px),linear-gradient(135deg,#51483c 0%,#40382f 60%,#332d26 100%) !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.045),inset 4px 0 12px rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] body .book-page-top,
html[data-theme="dark"] body .page-counter { color: #9d907a !important; }
html[data-theme="dark"] body .book-title { color: #f0e5d1 !important; }
html[data-theme="dark"] body .book-subtitle { color: #c5b79f !important; }
html[data-theme="dark"] body .book-page .book-form label { color: #d5c8b2 !important; }
html[data-theme="dark"] body .book-page .book-form input {
  min-height: 40px !important;
  border: 4px solid #080b09 !important;
  border-radius: 0 !important;
  color: #f1e8d8 !important;
  background: #343129 !important;
  background-image: linear-gradient(180deg,rgba(255,255,255,.035),rgba(0,0,0,.18)) !important;
  box-shadow: inset 3px 3px 0 #77796c,inset -3px -3px 0 #161813 !important;
  clip-path: polygon(6px 0,calc(100% - 6px) 0,calc(100% - 6px) 3px,100% 3px,100% calc(100% - 3px),calc(100% - 6px) calc(100% - 3px),calc(100% - 6px) 100%,6px 100%,6px calc(100% - 3px),0 calc(100% - 3px),0 3px,6px 3px) !important;
}
html[data-theme="dark"] body .book-page .book-form input:focus {
  background-color: #403d33 !important;
  border-color: #080b09 !important;
  box-shadow: inset 3px 3px 0 #858879,inset -3px -3px 0 #10120e,0 0 0 2px #a08a67 !important;
}
html[data-theme="dark"] body .book-page-link,
html[data-theme="dark"] body .book-inline-link { color: #d0b991 !important; }
html[data-theme="dark"] body .book-close { color: #f0e5d1 !important; }
html[data-theme="dark"] body .mc-writing-cursor { color: #f0e5d1 !important; }


/* ScRl visual hierarchy: gold completed frames for identity and headings, grey frames for choices. */
:root {
  --gold-frame-fill: #b48712;
  --gold-frame-edge: #17130a;
  --gold-frame-highlight: #f4d76f;
  --gold-frame-shadow: #644804;
  --choice-frame-fill: #c4c4c4;
  --choice-frame-edge: #111111;
  --choice-frame-highlight: #f2f2f2;
  --choice-frame-shadow: #5a5a5a;
}
html[data-theme="dark"] {
  --gold-frame-fill: #76550d;
  --gold-frame-edge: #080704;
  --gold-frame-highlight: #a9852d;
  --gold-frame-shadow: #241a08;
  --choice-frame-fill: #555b55;
  --choice-frame-edge: #080b09;
  --choice-frame-highlight: #858c82;
  --choice-frame-shadow: #20251f;
}
html body .brand-mark,html body .theme-btn,html body .auth-theme-btn,
html body .nav-tab.is-active,html body #page h1,html body #page h2 {
  border: 3px solid var(--gold-frame-edge) !important;
  border-radius: 0 !important;
  color: #2b210b !important;
  background: var(--gold-frame-fill) !important;
  box-shadow: inset 2px 2px 0 var(--gold-frame-highlight),inset -2px -2px 0 var(--gold-frame-shadow),3px 3px 0 var(--gold-frame-shadow) !important;
  clip-path: polygon(5px 0,calc(100% - 5px) 0,calc(100% - 5px) 3px,100% 3px,100% calc(100% - 3px),calc(100% - 5px) calc(100% - 3px),calc(100% - 5px) 100%,5px 100%,5px calc(100% - 3px),0 calc(100% - 3px),0 3px,5px 3px) !important;
}
html body .brand-mark { color: #fff4cc !important; }
html body .theme-btn,html body .auth-theme-btn { min-height: 36px !important; padding: 5px 10px !important; }
html body .nav-tab.is-active { padding: 5px 10px !important; }
html body #page h1,html body #page h2 { display: inline-block; max-width: 100%; padding: 4px 9px !important; margin-top: 4px; line-height: 1.55 !important; }
html[data-theme="dark"] body .brand-mark,html[data-theme="dark"] body .theme-btn,
html[data-theme="dark"] body .auth-theme-btn,html[data-theme="dark"] body .nav-tab.is-active,
html[data-theme="dark"] body #page h1,html[data-theme="dark"] body #page h2 { color: #ead18a !important; }
html[data-theme="dark"] body .brand-mark { color: #fff0bd !important; }

html body .button,html body .more-btn,html body .nav-tab:not(.is-active),
html body .more-menu button,html body .book-page-link,html body .book-inline-link,
html body .filter-row select,html body .filter-row input,html body .msg-form select,html body .msg-form input {
  border: 3px solid var(--choice-frame-edge) !important;
  border-radius: 0 !important;
  color: #242424 !important;
  background: var(--choice-frame-fill) !important;
  box-shadow: inset 2px 2px 0 var(--choice-frame-highlight),inset -2px -2px 0 var(--choice-frame-shadow),3px 3px 0 var(--choice-frame-shadow) !important;
}
html[data-theme="dark"] body .button,html[data-theme="dark"] body .more-btn,
html[data-theme="dark"] body .nav-tab:not(.is-active),html[data-theme="dark"] body .more-menu button,
html[data-theme="dark"] body .book-page-link,html[data-theme="dark"] body .book-inline-link,
html[data-theme="dark"] body .filter-row select,html[data-theme="dark"] body .filter-row input,
html[data-theme="dark"] body .msg-form select,html[data-theme="dark"] body .msg-form input { color: #e8ebe3 !important; }
html body .nav-tab:not(.is-active) { padding: 5px 9px !important; }
html body .button:hover,html body .more-btn:hover,html body .nav-tab:not(.is-active):hover,html body .more-menu button:hover { filter: brightness(1.07); }

/* Second page: practical guide to the ScRl platform. */
.book-page-kicker { margin-left: auto; color: #8b6a27; font: 8px/1.4 var(--mc-font); }
.book-guide-list { display: grid; gap: 7px; margin: 1px 0 8px; }
.book-guide-item {
  display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 8px; align-items: start;
  padding: 6px 7px; border: 2px solid #17130a; border-radius: 0;
  color: #332a1c; background: #c4c4c4;
  box-shadow: inset 2px 2px 0 #f2f2f2,inset -2px -2px 0 #5a5a5a,2px 2px 0 #5a5a5a;
}
.book-guide-number { display:grid; width:23px; height:23px; place-items:center; border:2px solid #17130a; color:#2b210b; background:#b48712; box-shadow:inset 1px 1px 0 #f4d76f,inset -1px -1px 0 #644804; font:8px/1 var(--mc-font); }
.book-guide-item h3 { margin:0 0 2px; color:#33260b; font:9px/1.35 var(--mc-font); }
.book-guide-item p { margin:0; color:#383838; font:8px/1.45 var(--mc-font); }
.book-guide-note { margin-top:auto; padding:7px 8px; border-left:3px solid #a5790e; color:#5b4b2c; background:rgba(180,135,18,.10); font:8px/1.45 var(--mc-font); }
html[data-theme="dark"] body .book-page-kicker { color:#9b813f !important; }
html[data-theme="dark"] body .book-guide-item { border-color:#080b09 !important; color:#d9ddcf !important; background:#555b55 !important; box-shadow:inset 2px 2px 0 #858c82,inset -2px -2px 0 #20251f,2px 2px 0 #20251f !important; }
html[data-theme="dark"] body .book-guide-number { border-color:#080704 !important; color:#ead18a !important; background:#76550d !important; box-shadow:inset 1px 1px 0 #a9852d,inset -1px -1px 0 #241a08 !important; }
html[data-theme="dark"] body .book-guide-item h3 { color:#ead18a !important; }
html[data-theme="dark"] body .book-guide-item p { color:#e0e3d9 !important; }
html[data-theme="dark"] body .book-guide-note { border-left-color:#8a6719 !important; color:#d3c49b !important; background:rgba(118,85,13,.16) !important; }

/* Back control sits slightly lower, with enough space from the page edge. */
html body .book-close { top:17px !important; right:12px !important; width:27px; height:27px; display:grid; place-items:center; }
html[data-theme="dark"] body .book-close { color:#e8ddc8 !important; }

/* System notifications appear at the upper-right, clear of the auth theme switch. */
html body .toast {
  position:fixed !important; top:18px !important; right:18px !important; bottom:auto !important;
  z-index:10000 !important; max-width:min(390px,calc(100vw - 36px)) !important;
  padding:12px 16px !important; border:3px solid #171717 !important; border-radius:0 !important;
  color:#242424 !important; background:#c4c4c4 !important;
  box-shadow:inset 2px 2px 0 #f2f2f2,inset -2px -2px 0 #5a5a5a,3px 3px 0 #5a5a5a !important;
  opacity:0; transform:translateY(-10px) !important; transition:opacity .2s ease,transform .2s ease !important;
}
html body .toast.is-visible { opacity:1; transform:translateY(0) !important; }
html[data-theme="dark"] body .toast { border-color:#080b09 !important; color:#e8ebe3 !important; background:#555b55 !important; box-shadow:inset 2px 2px 0 #858c82,inset -2px -2px 0 #20251f,3px 3px 0 #20251f !important; }
#auth:not([hidden]) ~ #toast { top:72px !important; }
@media (max-width:760px) {
  .book-guide-list { gap:5px; }
  .book-guide-item { grid-template-columns:21px minmax(0,1fr); padding:5px; gap:6px; }
  .book-guide-number { width:20px; height:20px; }
  .book-guide-item h3 { font-size:8px; }
  .book-guide-item p,.book-guide-note { font-size:7px; }
  html body .toast { top:max(12px,env(safe-area-inset-top)) !important; right:10px !important; max-width:calc(100vw - 20px) !important; }
  #auth:not([hidden]) ~ #toast { top:60px !important; }
  html body .book-close { top:15px !important; right:9px !important; }
}


:root { --scrl-toolbar-height:68px; --scrl-toolbar-control:38px; }
html body .topbar {
  position:sticky !important; top:0 !important; z-index:60 !important;
  height:var(--scrl-toolbar-height) !important; min-height:var(--scrl-toolbar-height) !important;
  border:0 !important; border-bottom:3px solid #695321 !important;
  background:rgba(238,238,218,.94) !important;
  box-shadow:0 4px 0 rgba(40,34,19,.18),0 12px 28px rgba(0,0,0,.10) !important;
  backdrop-filter:blur(18px) saturate(1.12) !important;
}
html[data-theme="dark"] body .topbar {
  border-bottom-color:#48370d !important; background:rgba(24,30,26,.94) !important;
  box-shadow:0 4px 0 rgba(0,0,0,.28),0 12px 28px rgba(0,0,0,.24) !important;
}
html body .topbar-inner {
  display:flex !important; width:min(calc(100% - 36px),1320px) !important;
  height:var(--scrl-toolbar-height) !important; min-height:var(--scrl-toolbar-height) !important;
  gap:12px !important; align-items:center !important; flex-wrap:nowrap !important;
}
html body .brand {
  display:inline-flex !important; flex:0 0 auto !important; height:var(--scrl-toolbar-control) !important;
  align-items:center !important; gap:8px !important; padding:0 7px 0 0 !important;
  color:#3a321d !important; font-size:18px !important; text-decoration:none !important;
}
html[data-theme="dark"] body .brand { color:#e4d6ad !important; }
html body .brand-mark {
  display:grid !important; width:var(--scrl-toolbar-control) !important;
  min-width:var(--scrl-toolbar-control) !important; height:var(--scrl-toolbar-control) !important; place-items:center !important;
}
html body .main-nav {
  display:flex !important; flex:1 1 auto !important; min-width:0 !important;
  height:var(--scrl-toolbar-control) !important; min-height:var(--scrl-toolbar-control) !important;
  align-self:center !important; align-items:center !important; gap:5px !important;
  overflow-x:auto !important; overflow-y:hidden !important; scrollbar-width:none !important;
}
html body .main-nav::-webkit-scrollbar { display:none !important; }
html body .main-nav .nav-tab {
  display:inline-flex !important; flex:0 0 auto !important;
  height:var(--scrl-toolbar-control) !important; min-height:var(--scrl-toolbar-control) !important;
  align-items:center !important; justify-content:center !important;
  margin:0 !important; padding:0 10px !important; line-height:1 !important; white-space:nowrap !important;
}
html body .topbar-actions,html body .topbar-user {
  display:flex !important; flex:0 0 auto !important; height:var(--scrl-toolbar-control) !important;
  align-items:center !important;
}
html body .topbar-actions { gap:8px !important; }
html body .topbar-user { gap:7px !important; }
html body .theme-btn,html body .more-btn,html body .logout-button,html body .notification-bell {
  display:inline-flex !important; flex:0 0 auto !important;
  height:var(--scrl-toolbar-control) !important; min-height:var(--scrl-toolbar-control) !important;
  align-items:center !important; justify-content:center !important; margin:0 !important; box-sizing:border-box !important;
}
html body .theme-btn { padding:0 10px !important; white-space:nowrap !important; }
html body .more-btn { min-width:66px !important; padding:0 9px !important; gap:5px; }
html body .logout-button { width:var(--scrl-toolbar-control) !important; height:var(--scrl-toolbar-control) !important; padding:0 !important; }
html body .user-avatar { width:34px !important; min-width:34px !important; height:34px !important; margin:0 !important; }
html body .user-name { max-width:115px !important; }
html body .more-wrap,html body .notification-wrap {
  position:relative !important; display:flex !important; flex:0 0 auto !important;
  height:var(--scrl-toolbar-control) !important; align-items:center !important; margin:0 !important;
}
html body .more-menu {
  top:calc(100% + 11px) !important; right:0 !important; z-index:80 !important;
  min-width:205px !important; padding:7px !important; border:3px solid #17130a !important;
  border-radius:0 !important; background:#c4c4c4 !important;
  box-shadow:3px 3px 0 #5a5a5a,0 14px 30px rgba(0,0,0,.2) !important;
}
html[data-theme="dark"] body .more-menu {
  border-color:#080b09 !important; background:#3c433c !important;
  box-shadow:3px 3px 0 #20251f,0 14px 30px rgba(0,0,0,.36) !important;
}
html body .more-menu button {
  display:flex !important; min-height:36px !important; align-items:center !important;
  justify-content:flex-start !important; padding:0 9px !important; text-align:left !important;
}
html body .more-menu button[hidden] { display:none !important; }

/* Bell control and live notification popover. */
html body .notification-bell {
  position:relative !important; width:var(--scrl-toolbar-control) !important;
  min-width:var(--scrl-toolbar-control) !important; padding:0 !important;
  border:3px solid var(--choice-frame-edge) !important; border-radius:0 !important;
  color:#262318 !important; background:var(--choice-frame-fill) !important;
  box-shadow:inset 2px 2px 0 var(--choice-frame-highlight),inset -2px -2px 0 var(--choice-frame-shadow),3px 3px 0 var(--choice-frame-shadow) !important;
  cursor:pointer !important;
}
html[data-theme="dark"] body .notification-bell { color:#e8ebe3 !important; }
html body .notification-bell:hover { filter:brightness(1.08); transform:translateY(-1px); }
html body .notification-bell.has-unread { border-color:var(--gold-frame-edge) !important; }
html body .notification-count {
  position:absolute !important; top:-8px !important; right:-8px !important;
  display:grid !important; min-width:18px !important; height:18px !important;
  place-items:center !important; padding:0 4px !important; border:2px solid #17130a !important;
  color:#fff8e5 !important; background:#9b342b !important; box-shadow:1px 1px 0 rgba(0,0,0,.35) !important;
  font:8px/1 var(--mc-font) !important;
}
html body .notification-count[hidden] { display:none !important; }
html body .notification-panel {
  position:absolute !important; top:calc(100% + 12px) !important; right:0 !important; z-index:90 !important;
  display:flex !important; width:min(370px,calc(100vw - 24px)) !important;
  max-height:min(470px,calc(100vh - 96px)) !important; flex-direction:column !important; overflow:hidden !important;
  border:3px solid #17130a !important; border-radius:0 !important; color:#29271f !important;
  background:#e5e3d7 !important; box-shadow:4px 4px 0 #5a5a5a,0 18px 40px rgba(0,0,0,.28) !important;
}
html body .notification-panel[hidden] { display:none !important; }
html[data-theme="dark"] body .notification-panel {
  border-color:#080b09 !important; color:#e5e8dc !important; background:#303831 !important;
  box-shadow:4px 4px 0 #20251f,0 18px 40px rgba(0,0,0,.46) !important;
}
.notification-panel-head {
  display:flex; min-height:58px; flex:0 0 auto; align-items:center; justify-content:space-between;
  gap:10px; padding:10px 12px; border-bottom:2px solid rgba(36,31,18,.24);
  background:#b48712; color:#2b210b;
}
.notification-panel-head>div { display:grid; gap:2px; }
.notification-panel-head strong { font:12px/1.35 var(--mc-font); }
.notification-panel-head small { color:rgba(43,33,11,.72); font:8px/1.3 var(--mc-font); }
html[data-theme="dark"] .notification-panel-head { background:#76550d; color:#f0d995; border-bottom-color:#241a08; }
html[data-theme="dark"] .notification-panel-head small { color:#d2bd82; }
html body .notification-panel-head button,html body .notification-panel-foot button {
  min-height:29px; padding:4px 7px; border:2px solid #17130a; border-radius:0;
  color:#262318; background:#c4c4c4; box-shadow:inset 1px 1px 0 #f2f2f2,inset -1px -1px 0 #5a5a5a;
  font:8px/1.4 var(--mc-font); white-space:nowrap;
}
html[data-theme="dark"] body .notification-panel-head button,html[data-theme="dark"] body .notification-panel-foot button {
  border-color:#080b09; color:#e8ebe3; background:#555b55;
  box-shadow:inset 1px 1px 0 #858c82,inset -1px -1px 0 #20251f;
}
.notification-panel-head button:disabled { opacity:.5; cursor:default; }
.notification-list { min-height:62px; overflow-y:auto; }
html body .notification-item {
  display:flex; width:100%; min-height:58px; align-items:flex-start; gap:10px; padding:10px 12px;
  border:0; border-bottom:1px solid rgba(70,64,48,.18); border-left:3px solid transparent;
  border-radius:0; color:#302d24; background:transparent; text-align:left; cursor:pointer;
}
html body .notification-item:hover { background:rgba(180,135,18,.10); }
html body .notification-item.is-unread { border-left-color:#a5790e; background:rgba(180,135,18,.08); }
html[data-theme="dark"] body .notification-item { color:#e5e8dc; border-bottom-color:rgba(255,255,255,.09); }
html[data-theme="dark"] body .notification-item:hover { background:rgba(180,135,18,.13); }
html[data-theme="dark"] body .notification-item.is-unread { border-left-color:#a9852d; background:rgba(118,85,13,.15); }
.notification-dot { width:8px; min-width:8px; height:8px; margin-top:4px; border:2px solid #6b6657; border-radius:50%; background:transparent; }
.notification-item.is-unread .notification-dot { border-color:#9b342b; background:#9b342b; }
.notification-copy { display:grid; min-width:0; gap:4px; }
.notification-text { overflow-wrap:anywhere; font:9px/1.5 var(--mc-font); }
.notification-copy time { color:#6f6b60; font:7px/1.35 var(--mc-font); }
html[data-theme="dark"] .notification-copy time { color:#aeb6a7; }
.notification-empty { padding:20px 14px; color:#777367; font:9px/1.6 var(--mc-font); text-align:center; }
html[data-theme="dark"] .notification-empty { color:#b5bcac; }
.notification-panel-foot { display:flex; flex:0 0 auto; justify-content:center; padding:9px; border-top:2px solid rgba(36,31,18,.16); }
html[data-theme="dark"] .notification-panel-foot { border-top-color:rgba(255,255,255,.08); }

/* The logged-in app softens its scenery only; the authentication book remains crisp. */
html body.app-active .world-scenery {
  filter:blur(7px) brightness(.74) saturate(.82) !important;
  transform:scale(1.045) !important;
  transition:filter .28s ease,transform .28s ease !important;
}
html body:not(.app-active) .world-scenery {
  filter:none !important; transform:none !important; transition:filter .28s ease,transform .28s ease !important;
}
html body #app:not([hidden]) ~ #toast { top:82px !important; right:18px !important; }
html body #auth:not([hidden]) ~ #toast { top:18px !important; right:18px !important; }

@media (max-width:900px) {
  html body .topbar-inner { width:calc(100% - 20px) !important; gap:7px !important; }
  html body .topbar-actions { gap:5px !important; }
  html body .main-nav { gap:3px !important; }
  html body .main-nav .nav-tab { padding:0 8px !important; font-size:9px !important; }
  html body .theme-btn { font-size:9px !important; padding:0 7px !important; }
}
@media (max-width:620px) {
  html body .topbar-inner { width:calc(100% - 12px) !important; gap:5px !important; }
  html body .brand { gap:4px !important; font-size:13px !important; }
  html body .brand-mark { width:34px !important; min-width:34px !important; height:34px !important; }
  html body .topbar-actions { gap:4px !important; }
  html body .more-btn { min-width:34px !important; width:34px !important; font-size:0 !important; }
  html body .more-btn span { font-size:12px !important; }
  html body .user-name { display:none !important; }
  html body .theme-btn { width:38px !important; min-width:38px !important; padding:0 !important; font-size:0 !important; }
  html body .theme-btn::after { content:"☀"; font:15px/1 var(--mc-font); }
  html[data-theme="light"] body .theme-btn::after { content:"☾"; }
  html body .user-avatar { width:30px !important; min-width:30px !important; height:30px !important; }
  html body .topbar-user { gap:4px !important; }
  html body .main-nav { flex:1 1 auto !important; }
  html body #app:not([hidden]) ~ #toast { top:73px !important; right:10px !important; }
  html body .notification-panel { width:min(340px,calc(100vw - 16px)) !important; }
}


/* ScRl refinement pass: more useful space, clearer text and consistent controls. */
:root {
  --scrl-toolbar-height: 76px;
  --scrl-toolbar-control: 44px;
}
html body .topbar {
  height: var(--scrl-toolbar-height) !important;
  min-height: var(--scrl-toolbar-height) !important;
}
html body .topbar-inner {
  width: min(calc(100% - 40px), 1440px) !important;
  height: var(--scrl-toolbar-height) !important;
  min-height: var(--scrl-toolbar-height) !important;
  gap: 10px !important;
}
html body .brand { font-size: 20px !important; }
html body .brand-mark {
  width: var(--scrl-toolbar-control) !important;
  min-width: var(--scrl-toolbar-control) !important;
  height: var(--scrl-toolbar-control) !important;
}
html body .main-nav { gap: 6px !important; }
html body .main-nav .nav-tab {
  min-height: var(--scrl-toolbar-control) !important;
  height: var(--scrl-toolbar-control) !important;
  padding: 0 11px !important;
  font-size: 12px !important;
}
html body .topbar-actions { gap: 9px !important; }
html body .topbar-user { gap: 8px !important; }
html body .theme-btn,
html body .more-btn,
html body .logout-button,
html body .notification-bell {
  min-height: var(--scrl-toolbar-control) !important;
  height: var(--scrl-toolbar-control) !important;
  font-size: 12px !important;
}
html body .theme-btn { padding: 0 12px !important; }
html body .more-btn { min-width: 78px !important; padding: 0 12px !important; }
html body .logout-button {
  width: var(--scrl-toolbar-control) !important;
  min-width: var(--scrl-toolbar-control) !important;
}
html body .user-avatar {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
}
html body .user-name { max-width: 145px !important; font-size: 12px !important; }
html body .topbar-balance {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  height: var(--scrl-toolbar-control) !important;
  min-width: 154px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 3px solid var(--choice-frame-edge) !important;
  border-radius: 0 !important;
  color: #30291d !important;
  background: var(--choice-frame-fill) !important;
  box-shadow: inset 2px 2px 0 var(--choice-frame-highlight),inset -2px -2px 0 var(--choice-frame-shadow),3px 3px 0 var(--choice-frame-shadow) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
html body .topbar-balance:hover { filter: brightness(1.06); transform: translateY(-1px); }
html[data-theme="dark"] body .topbar-balance { color: #f0e8d7 !important; }
html body .balance-group { display: inline-flex; align-items: baseline; gap: 5px; }
html body .balance-group small { color: #62583f !important; font: 10px/1 var(--mc-font) !important; }
html body .balance-group strong { color: inherit !important; font: 13px/1 var(--mc-font) !important; }
html[data-theme="dark"] body .balance-group small { color: #d9ceb9 !important; }
html body .balance-divider { opacity: .55; font: 14px/1 var(--mc-font); }
html body .notification-bell { width: var(--scrl-toolbar-control) !important; min-width: var(--scrl-toolbar-control) !important; }

html body { font-size: 15px !important; line-height: 1.68 !important; }
html body #page {
  width: 100% !important;
  font-size: 15px !important;
  line-height: 1.68 !important;
}
html body .page-wrap {
  width: min(calc(100% - 48px), 1200px) !important;
  padding-top: 28px !important;
  padding-bottom: 56px !important;
}
html body .welcome-block { max-width: 1120px !important; }
html body #page h1 { font-size: clamp(27px, 3.2vw, 36px) !important; line-height: 1.35 !important; }
html body #page h2 { font-size: 21px !important; line-height: 1.45 !important; }
html body #page h3 { font-size: 16px !important; line-height: 1.45 !important; }
html body #page p,
html body #page li,
html body #page .data-row,
html body #page .notification-text { font-size: 14px !important; line-height: 1.65 !important; }
html body #page .eyebrow { font-size: 12px !important; line-height: 1.5 !important; }
html body #page .small,
html body #page .muted,
html body #page .section-hint,
html body #page .demo-note,
html body #page .data-row small,
html body #page .demo-stat span,
html body #page .demo-stat small,
html body #page .card-top .small {
  color: #6a5b45 !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}
html[data-theme="dark"] body #page .small,
html[data-theme="dark"] body #page .muted,
html[data-theme="dark"] body #page .section-hint,
html[data-theme="dark"] body #page .demo-note,
html[data-theme="dark"] body #page .data-row small,
html[data-theme="dark"] body #page .demo-stat span,
html[data-theme="dark"] body #page .demo-stat small,
html[data-theme="dark"] body #page .card-top .small {
  color: #eee5d2 !important;
}
html[data-theme="dark"] body #page .plus { color: #cfe6b8 !important; }
html[data-theme="dark"] body #page .minus { color: #f1b7a8 !important; }
html body .nav-tab:not(.is-active) { color: #665940 !important; font-size: 12px !important; }
html[data-theme="dark"] body .nav-tab:not(.is-active) { color: #e7dfce !important; }
html body .user-name { color: #6a5b45 !important; }
html[data-theme="dark"] body .user-name { color: #eee5d2 !important; }
html body .button,
html body .more-menu button,
html body .filter-row button,
html body .msg-form button {
  min-height: 42px !important;
  padding: 8px 13px !important;
  font-size: 13px !important;
}
html body .text-button {
  min-height: 32px !important;
  padding: 5px 8px !important;
  font-size: 12px !important;
}
html body .filter-row input,
html body .filter-row select,
html body .msg-form input,
html body .msg-form select { min-height: 42px !important; font-size: 13px !important; }

.home-overview {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 16px;
  margin-top: 28px;
}
.home-overview-card {
  display: flex;
  min-width: 0;
  min-height: 178px;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  border: 3px solid var(--choice-frame-edge);
  color: #302d24;
  background: rgba(226,226,218,.94);
  box-shadow: inset 2px 2px 0 var(--choice-frame-highlight),inset -2px -2px 0 var(--choice-frame-shadow),3px 3px 0 var(--choice-frame-shadow);
}
html[data-theme="dark"] body .home-overview-card {
  color: #eee5d2;
  background: rgba(55,63,56,.94);
}
.home-overview-label { color: #78653e; font: 11px/1.5 var(--mc-font); }
.home-overview-value { margin: 12px 0 8px; font: 30px/1.1 var(--mc-font); }
.home-overview-card p { margin: 0; color: #6a5b45; font: 13px/1.6 var(--mc-font) !important; }
html[data-theme="dark"] body .home-overview-label { color: #d6bc78; }
html[data-theme="dark"] body .home-overview-card p { color: #eee5d2 !important; }

 /* The auth book is enlarged, with page contents kept inside the paper edges. */
#auth .auth-stage { width: min(100%, 1180px) !important; gap: 16px !important; }
#auth .auth-book {
  width: min(540px,calc(100vw - 36px)) !important;
  height: min(660px,calc(100svh - 154px)) !important;
  min-height: 480px !important;
}
#auth .auth-book.is-spread {
  width: min(1100px,calc(100vw - 44px)) !important;
  height: min(660px,calc(100svh - 154px)) !important;
  min-height: 480px !important;
}
#auth .book-page,
#auth .book-page * { box-sizing: border-box !important; min-width: 0 !important; }
#auth .book-page {
  overflow: hidden !important;
  padding: 25px 34px 22px !important;
}
#auth .book-page-top {
  min-height: 19px !important;
  justify-content: flex-start !important;
  margin: 0 0 15px !important;
  padding: 0 48px 0 0 !important;
  font-size: 12px !important;
}
#auth .page-counter { font-size: 12px !important; line-height: 1.4 !important; }
#auth .book-title {
  margin: 3px 0 9px !important;
  font-size: clamp(20px,2vw,24px) !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere !important;
}
#auth .book-subtitle {
  margin: 0 0 18px !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  overflow-wrap: anywhere !important;
}
#auth .book-page .book-form {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
#auth .book-page .book-form label {
  margin: 8px 0 4px !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere !important;
}
#auth .book-page .book-form .mc-input-shell {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
#auth .book-page .book-form input {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 7px 9px !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#auth .book-page .book-form .form-error {
  min-height: 16px !important;
  margin: 4px 0 0 !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
  overflow-wrap: anywhere !important;
}
#auth .book-page-link,
#auth .book-inline-link {
  max-width: 100% !important;
  margin-top: 10px !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}
#auth .book-page--spread-right .book-copy { margin-bottom: 8px !important; }
#auth .book-copy--registration .book-title { font-size: 21px !important; }
#auth .book-page .book-form--registration label {
  margin: 5px 0 3px !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}
#auth .book-page .book-form--registration input {
  min-height: 36px !important;
  padding: 6px 8px !important;
  font-size: 11.5px !important;
}
#auth .book-page--spread-right .book-subtitle { margin-bottom: 8px !important; }
#auth .book-page .book-inline-link { margin-top: 6px !important; }
#auth .book-page #backToLogin {
  top: 37px !important;
  right: 16px !important;
  width: 30px !important;
  height: 30px !important;
  display: grid !important;
  place-items: center !important;
  z-index: 12 !important;
  font-size: 22px !important;
}
#auth .book-page-top .page-counter { padding-right: 34px !important; }
#auth .book-actions { width: min(100%,220px) !important; gap: 0 !important; }
#auth .book-action-button {
  min-height: 46px !important;
  font-size: 13px !important;
}

.book-guide-list { gap: 10px !important; margin: 4px 0 12px !important; }
.book-guide-item {
  grid-template-columns: 32px minmax(0,1fr) !important;
  gap: 10px !important;
  padding: 9px 10px !important;
}
.book-guide-number { width: 29px !important; height: 29px !important; font-size: 11px !important; }
.book-guide-item h3 { margin-bottom: 4px !important; font-size: 13px !important; line-height: 1.45 !important; }
.book-guide-item p { font-size: 11.5px !important; line-height: 1.55 !important; overflow-wrap: anywhere !important; }
.book-guide-note { padding: 9px 11px !important; font-size: 11.5px !important; line-height: 1.55 !important; overflow-wrap: anywhere !important; }
.book-page-kicker { font-size: 10px !important; }

@keyframes scrl-book-page-left {
  from { opacity: 0; transform: translateX(-18px) rotateY(5deg); filter: brightness(.82); }
  to { opacity: 1; transform: translateX(0) rotateY(0); filter: brightness(1); }
}
@keyframes scrl-book-page-right {
  from { opacity: 0; transform: translateX(18px) rotateY(-5deg); filter: brightness(.82); }
  to { opacity: 1; transform: translateX(0) rotateY(0); filter: brightness(1); }
}
.auth-book.is-spread .book-page--spread-left {
  animation: scrl-book-page-left .48s cubic-bezier(.2,.72,.18,1) .12s both;
}
.auth-book.is-spread .book-page--spread-right {
  animation: scrl-book-page-right .52s cubic-bezier(.2,.72,.18,1) .2s both;
}
.book-page--single { transition: transform .72s cubic-bezier(.2,.72,.18,1),opacity .3s ease,visibility .3s !important; }

html body #page .muted,
html body #page .small,
html body #page .section-hint,
html body #page .demo-note,
html body #page .data-row small,
html body #page .demo-stat span,
html body #page .demo-stat small,
html body #page .activity-item small,
html body #page .card-top .small {
  color: #6a5b45 !important;
}
html[data-theme="dark"] body #page .muted,
html[data-theme="dark"] body #page .small,
html[data-theme="dark"] body #page .section-hint,
html[data-theme="dark"] body #page .demo-note,
html[data-theme="dark"] body #page .data-row small,
html[data-theme="dark"] body #page .demo-stat span,
html[data-theme="dark"] body #page .demo-stat small,
html[data-theme="dark"] body #page .activity-item small,
html[data-theme="dark"] body #page .card-top .small {
  color: #f0e7d6 !important;
}
html[data-theme="dark"] body .notification-copy time,
html[data-theme="dark"] body .notification-empty { color: #e1d7c3 !important; }
html body .notification-copy time,
html body .notification-empty { color: #6a5b45 !important; }

@media (max-width: 1100px) {
  html body .topbar-inner { width: calc(100% - 24px) !important; gap: 7px !important; }
  html body .topbar-actions { gap: 6px !important; }
  html body .main-nav { gap: 3px !important; }
  html body .main-nav .nav-tab { padding: 0 8px !important; font-size: 11px !important; }
  html body .topbar-balance { min-width: 132px !important; gap: 6px !important; padding: 0 7px !important; }
  html body .topbar-balance .balance-group small { font-size: 9px !important; }
}
@media (max-width: 900px) {
  html body .topbar { --scrl-toolbar-height: 70px; --scrl-toolbar-control: 42px; }
  .home-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html body .page-wrap { width: min(calc(100% - 32px), 1000px) !important; }
}
@media (max-width: 620px) {
  html body .topbar { --scrl-toolbar-height: 68px; --scrl-toolbar-control: 40px; }
  html body .topbar-inner { width: calc(100% - 12px) !important; gap: 4px !important; }
  html body .brand { gap: 4px !important; font-size: 14px !important; }
  html body .brand-mark { width: 32px !important; min-width: 32px !important; height: 32px !important; }
  html body .topbar-actions { gap: 4px !important; }
  html body .more-btn { min-width: 34px !important; width: 34px !important; padding: 0 !important; font-size: 0 !important; }
  html body .more-btn span { font-size: 12px !important; }
  html body .topbar-balance { min-width: 78px !important; height: 40px !important; gap: 0 !important; padding: 0 7px !important; }
  html body .balance-group--vrub, html body .balance-divider { display: none !important; }
  html body .balance-group--scrl { gap: 5px !important; }
  html body .balance-group--scrl small { font-size: 9px !important; }
  html body .balance-group--scrl strong { font-size: 11px !important; }
  html body .user-name { display: none !important; }
  html body .theme-btn { width: 40px !important; min-width: 40px !important; padding: 0 !important; font-size: 0 !important; }
  html body .theme-btn::after { content: "☀"; font: 15px/1 var(--mc-font); }
  html[data-theme="light"] body .theme-btn::after { content: "☾"; }
  html body .user-avatar { width: 30px !important; min-width: 30px !important; height: 30px !important; }
  html body .topbar-user { gap: 3px !important; }
  html body .main-nav { flex: 1 1 auto !important; }
  html body .main-nav .nav-tab { padding: 0 7px !important; font-size: 10px !important; }
  html body .page-wrap { width: calc(100% - 24px) !important; padding-top: 22px !important; }
  .home-overview { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
  .home-overview-card { min-height: 145px; padding: 13px; }
  .home-overview-value { font-size: 24px; }
  #auth .auth-stage { width: 100% !important; }
  #auth .auth-book { width: calc(100vw - 28px) !important; height: min(650px,calc(100svh - 146px)) !important; min-height: 450px !important; }
  #auth .auth-book.is-spread { width: calc(100vw - 12px) !important; height: min(660px,calc(100svh - 126px)) !important; min-height: 460px !important; }
  #auth .book-page--single { inset: 10px !important; padding: 22px 18px !important; }
  #auth .book-spread { inset: 10px !important; }
  #auth .book-spread .book-page { padding: 16px 10px 14px !important; }
  #auth .book-page-top { margin-bottom: 12px !important; }
  #auth .book-title { font-size: 16px !important; }
  #auth .book-subtitle { font-size: 10.5px !important; margin-bottom: 12px !important; }
  #auth .book-page .book-form label { font-size: 10px !important; margin-top: 5px !important; }
  #auth .book-page .book-form input { min-height: 32px !important; padding: 4px 5px !important; font-size: 10px !important; }
  #auth .book-page .book-form--registration label { font-size: 9.5px !important; }
  #auth .book-page .book-form--registration input { min-height: 31px !important; font-size: 9.5px !important; }
  #auth .book-page-link, #auth .book-inline-link { font-size: 10px !important; }
  #auth .book-guide-list { gap: 6px !important; }
  #auth .book-guide-item { grid-template-columns: 24px minmax(0,1fr) !important; gap: 6px !important; padding: 6px !important; }
  #auth .book-guide-number { width: 22px !important; height: 22px !important; font-size: 9px !important; }
  #auth .book-guide-item h3 { font-size: 10.5px !important; }
  #auth .book-guide-item p, #auth .book-guide-note { font-size: 9.5px !important; line-height: 1.45 !important; }
  #auth .book-page #backToLogin { top: 33px !important; right: 10px !important; }
  #auth .book-page-top .page-counter { padding-right: 36px !important; }
  #auth .book-quill { display: none !important; }
  html body #app:not([hidden]) ~ #toast { top: 73px !important; right: 9px !important; }
}
@media (max-width: 380px) {
  #auth .book-spread .book-page { padding-left: 8px !important; padding-right: 8px !important; }
  #auth .book-page .book-form label { font-size: 9px !important; }
  #auth .book-page .book-form input { font-size: 9px !important; }
  #auth .book-page .book-form--registration input { font-size: 9px !important; }
}
@media (max-height: 680px) {
  #auth .auth-book { height: calc(100svh - 150px) !important; min-height: 390px !important; }
  #auth .auth-book.is-spread { height: calc(100svh - 150px) !important; min-height: 390px !important; }
}


/* Pastel balance pass: keep the existing green / gold / neutral identity. */
html[data-theme="light"] {
  --scrl-pastel-page: #f0f4ea;
  --scrl-pastel-card: #e5eddf;
  --scrl-pastel-card-alt: #dce7d5;
  --scrl-pastel-edge: #9eaf91;
  --scrl-pastel-text: #344538;
  --scrl-pastel-muted: #647764;
  --scrl-pastel-choice: #d5d9d2;
  --scrl-pastel-choice-edge: #7b8678;
  --scrl-pastel-choice-text: #3d493d;
  --scrl-pastel-gold: #e5d4a0;
  --scrl-pastel-gold-text: #514322;
  --scrl-pastel-shadow: rgba(65,82,59,.16);
}
html[data-theme="dark"] {
  --scrl-pastel-page: #202a25;
  --scrl-pastel-card: #2b3830;
  --scrl-pastel-card-alt: #35443a;
  --scrl-pastel-edge: #586b5b;
  --scrl-pastel-text: #eee9dc;
  --scrl-pastel-muted: #c4d0c1;
  --scrl-pastel-choice: #465249;
  --scrl-pastel-choice-edge: #202a24;
  --scrl-pastel-choice-text: #eee9dc;
  --scrl-pastel-gold: #695b36;
  --scrl-pastel-gold-text: #f0dfad;
  --scrl-pastel-shadow: rgba(0,0,0,.28);
}
html[data-theme="light"] body #app:not([hidden]) { color: var(--scrl-pastel-text) !important; }
html[data-theme="dark"] body #app:not([hidden]) { color: var(--scrl-pastel-text) !important; }
html[data-theme="light"] body .topbar {
  background: rgba(235,242,228,.96) !important;
  border-bottom-color: #9aa98d !important;
  box-shadow: 0 4px 0 rgba(81,103,74,.12),0 12px 28px rgba(0,0,0,.08) !important;
}
html[data-theme="dark"] body .topbar {
  background: rgba(33,44,37,.96) !important;
  border-bottom-color: #596b52 !important;
  box-shadow: 0 4px 0 rgba(0,0,0,.24),0 12px 28px rgba(0,0,0,.22) !important;
}
html[data-theme="light"] body .topbar-balance,
html[data-theme="light"] body .notification-bell,
html[data-theme="light"] body .nav-tab:not(.is-active),
html[data-theme="light"] body .more-btn {
  color: var(--scrl-pastel-choice-text) !important;
  background: var(--scrl-pastel-choice) !important;
  border-color: var(--scrl-pastel-choice-edge) !important;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.72),inset -2px -2px 0 rgba(73,85,70,.16),2px 2px 0 rgba(73,85,70,.16) !important;
}
html[data-theme="dark"] body .topbar-balance,
html[data-theme="dark"] body .notification-bell,
html[data-theme="dark"] body .nav-tab:not(.is-active),
html[data-theme="dark"] body .more-btn {
  color: var(--scrl-pastel-choice-text) !important;
  background: var(--scrl-pastel-choice) !important;
  border-color: var(--scrl-pastel-choice-edge) !important;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.08),inset -2px -2px 0 rgba(0,0,0,.22),2px 2px 0 rgba(0,0,0,.2) !important;
}
html[data-theme="light"] body .nav-tab.is-active,
html[data-theme="light"] body #page h1,
html[data-theme="light"] body #page h2,
html[data-theme="light"] body .theme-btn,
html[data-theme="light"] body .brand-mark {
  color: var(--scrl-pastel-gold-text) !important;
  background: var(--scrl-pastel-gold) !important;
  border-color: #a18b53 !important;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.55),inset -2px -2px 0 rgba(119,96,43,.16),2px 2px 0 rgba(119,96,43,.18) !important;
}
html[data-theme="dark"] body .nav-tab.is-active,
html[data-theme="dark"] body #page h1,
html[data-theme="dark"] body #page h2,
html[data-theme="dark"] body .theme-btn,
html[data-theme="dark"] body .brand-mark {
  color: var(--scrl-pastel-gold-text) !important;
  background: var(--scrl-pastel-gold) !important;
  border-color: #40371f !important;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.07),inset -2px -2px 0 rgba(0,0,0,.23),2px 2px 0 rgba(0,0,0,.24) !important;
}
html[data-theme="light"] body #page .demo-card,
html[data-theme="light"] body #page .demo-stat,
html[data-theme="light"] body #page .demo-form,
html[data-theme="light"] body #page .match-box,
html[data-theme="light"] body #page .chat-box,
html[data-theme="light"] body #page .home-overview-card,
html[data-theme="light"] body #page .demo-columns section {
  color: var(--scrl-pastel-text) !important;
  border-color: var(--scrl-pastel-edge) !important;
  background: var(--scrl-pastel-card) !important;
  box-shadow: 0 3px 0 var(--scrl-pastel-shadow),inset 1px 1px 0 rgba(255,255,255,.55) !important;
}
html[data-theme="dark"] body #page .demo-card,
html[data-theme="dark"] body #page .demo-stat,
html[data-theme="dark"] body #page .demo-form,
html[data-theme="dark"] body #page .match-box,
html[data-theme="dark"] body #page .chat-box,
html[data-theme="dark"] body #page .home-overview-card,
html[data-theme="dark"] body #page .demo-columns section {
  color: var(--scrl-pastel-text) !important;
  border-color: var(--scrl-pastel-edge) !important;
  background: var(--scrl-pastel-card) !important;
  box-shadow: 0 3px 0 var(--scrl-pastel-shadow),inset 1px 1px 0 rgba(255,255,255,.035) !important;
}
html[data-theme="light"] body #page .muted,
html[data-theme="light"] body #page .small,
html[data-theme="light"] body #page .section-hint,
html[data-theme="light"] body #page .demo-note,
html[data-theme="light"] body #page .data-row small,
html[data-theme="light"] body #page .demo-stat span,
html[data-theme="light"] body #page .demo-stat small,
html[data-theme="light"] body #page .activity-item small,
html[data-theme="light"] body #page .card-top .small {
  color: var(--scrl-pastel-muted) !important;
}
html[data-theme="dark"] body #page .muted,
html[data-theme="dark"] body #page .small,
html[data-theme="dark"] body #page .section-hint,
html[data-theme="dark"] body #page .demo-note,
html[data-theme="dark"] body #page .data-row small,
html[data-theme="dark"] body #page .demo-stat span,
html[data-theme="dark"] body #page .demo-stat small,
html[data-theme="dark"] body #page .activity-item small,
html[data-theme="dark"] body #page .card-top .small {
  color: var(--scrl-pastel-muted) !important;
}
html[data-theme="light"] body #page .button,
html[data-theme="light"] body #page .more-menu button,
html[data-theme="light"] body #page .text-button {
  color: var(--scrl-pastel-choice-text) !important;
}
html[data-theme="dark"] body #page .button,
html[data-theme="dark"] body #page .more-menu button,
html[data-theme="dark"] body #page .text-button {
  color: var(--scrl-pastel-choice-text) !important;
}
html[data-theme="light"] body .notification-panel {
  color: var(--scrl-pastel-text) !important;
  border-color: var(--scrl-pastel-edge) !important;
  background: var(--scrl-pastel-page) !important;
}
html[data-theme="dark"] body .notification-panel {
  color: var(--scrl-pastel-text) !important;
  border-color: var(--scrl-pastel-edge) !important;
  background: var(--scrl-pastel-page) !important;
}
html[data-theme="light"] body .notification-item { color:var(--scrl-pastel-text) !important; }
html[data-theme="light"] body .notification-copy time,
html[data-theme="light"] body .notification-empty { color:var(--scrl-pastel-muted) !important; }
html[data-theme="dark"] body .notification-copy time,
html[data-theme="dark"] body .notification-empty { color:var(--scrl-pastel-muted) !important; }

/* A stable page change replaces the broken 3D hinge with a clean soft slide. */
#auth .auth-stage { perspective:none !important; }
#auth .auth-book {
  overflow:hidden !important;
  transform:none !important;
  transform-style:flat !important;
  transition:width .34s ease,height .34s ease,box-shadow .34s ease !important;
}
#auth .book-page--single {
  transform:none !important;
  transform-origin:center center !important;
  backface-visibility:visible !important;
  transition:opacity .22s ease,transform .28s ease,visibility .22s ease !important;
}
#auth .auth-book.is-spread .book-page--single {
  transform:translateX(-12px) scale(.985) !important;
  opacity:0 !important;
  visibility:hidden !important;
}
#auth .book-spread {
  transform:none !important;
  transition:opacity .3s ease,visibility .3s ease !important;
}
#auth .book-spread .book-page {
  transform:none !important;
  backface-visibility:visible !important;
}
#auth .auth-book.is-spread .book-page--spread-left,
#auth .auth-book.is-spread .book-page--spread-right { animation:none !important; }
@media (prefers-reduced-motion: reduce) {
  #auth .auth-book,
  #auth .book-page--single,
  #auth .book-spread,
  #auth .book-spread .book-page { transition:none !important; animation:none !important; }
}

/* Give the registration switch breathing room inside the first page. */
#auth #openRegistration {
  display:inline-flex !important;
  width:fit-content !important;
  max-width:100% !important;
  min-height:45px !important;
  align-items:center !important;
  justify-content:center !important;
  margin:16px 0 3px !important;
  padding:9px 15px !important;
  border:2px solid #8d987d !important;
  background:#dfe8d8 !important;
  box-shadow:inset 1px 1px 0 rgba(255,255,255,.75),inset -1px -1px 0 rgba(69,85,63,.16),2px 2px 0 rgba(69,85,63,.18) !important;
  color:#40533f !important;
  font-size:12px !important;
  line-height:1.5 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  text-decoration:none !important;
}
html[data-theme="dark"] body #auth #openRegistration {
  border-color:#465849 !important;
  color:#e8eadf !important;
  background:#35443a !important;
  box-shadow:inset 1px 1px 0 rgba(255,255,255,.08),inset -1px -1px 0 rgba(0,0,0,.26),2px 2px 0 rgba(0,0,0,.25) !important;
}

/* Light and dark book paper are two calm pastel variations of the same palette. */
html[data-theme="light"] body #auth .book-page {
  color:#374538 !important;
  border-color:#c3cdb9 !important;
  background:linear-gradient(135deg,#f5f4e9 0%,#edf0e2 64%,#e5eadb 100%) !important;
}
html[data-theme="light"] body #auth .book-title { color:#3f5140 !important; }
html[data-theme="light"] body #auth .book-subtitle,
html[data-theme="light"] body #auth .book-page .book-form label { color:#64755f !important; }
html[data-theme="light"] body #auth .page-counter,
html[data-theme="light"] body #auth .book-page-top { color:#71806a !important; }
html[data-theme="light"] body #auth .book-guide-item {
  color:#3d4a3b !important;
  border-color:#a8b49d !important;
  background:#e2e9dc !important;
  box-shadow:inset 2px 2px 0 rgba(255,255,255,.7),inset -2px -2px 0 rgba(78,94,72,.15),2px 2px 0 rgba(78,94,72,.15) !important;
}
html[data-theme="light"] body #auth .book-guide-item h3 { color:#4d6048 !important; }
html[data-theme="light"] body #auth .book-guide-item p { color:#52634f !important; }
html[data-theme="light"] body #auth .book-guide-note {
  color:#5a634a !important;
  border-left-color:#b39858 !important;
  background:rgba(201,181,122,.16) !important;
}
html[data-theme="dark"] body #auth .book-page {
  color:#eee9dc !important;
  border-color:#343e35 !important;
  background:linear-gradient(135deg,#303b33 0%,#29342d 64%,#222c26 100%) !important;
}
html[data-theme="dark"] body #auth .book-title { color:#f0e8d7 !important; }
html[data-theme="dark"] body #auth .book-subtitle,
html[data-theme="dark"] body #auth .book-page .book-form label { color:#d0d8c9 !important; }
html[data-theme="dark"] body #auth .page-counter,
html[data-theme="dark"] body #auth .book-page-top { color:#c3cbbd !important; }
html[data-theme="dark"] body #auth .book-guide-item {
  color:#eee9dc !important;
  border-color:#4a5b4d !important;
  background:#3a493e !important;
  box-shadow:inset 2px 2px 0 rgba(255,255,255,.07),inset -2px -2px 0 rgba(0,0,0,.24),2px 2px 0 rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] body #auth .book-guide-item h3 { color:#e7d6a5 !important; }
html[data-theme="dark"] body #auth .book-guide-item p { color:#e4e6d9 !important; }
html[data-theme="dark"] body #auth .book-guide-note {
  color:#e5dbbd !important;
  border-left-color:#8b7845 !important;
  background:rgba(105,91,54,.18) !important;
}

/* All book page children stay inside the paper, including the OTP helper and errors. */
#auth .book-page { box-sizing:border-box !important; }
#auth .book-page *,
#auth .book-page *::before,
#auth .book-page *::after { box-sizing:border-box !important; }
#auth .book-page .book-form input { max-width:100% !important; }
#auth #codeForm .code-info {
  margin:0 0 12px !important;
  padding:10px 12px !important;
  border:1px solid #aab69f !important;
  color:#4e624b !important;
  background:#e5ecdf !important;
  font-size:12px !important;
  line-height:1.55 !important;
  overflow-wrap:anywhere !important;
}
html[data-theme="dark"] body #auth #codeForm .code-info {
  border-color:#526353 !important;
  color:#e5e9dc !important;
  background:#354239 !important;
}


/* OTP: keep every digit visible and let the browser place its real caret. */
#auth #codeForm .mc-input-shell {
  overflow: visible !important;
}
#auth #codeForm input#code {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 8px 7px !important;
  border-width: 2px !important;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
  font-size: clamp(17px, 2vw, 22px) !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: .12em !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  caret-color: #65472e !important;
}
html[data-theme="dark"] body #auth #codeForm input#code {
  caret-color: #f0d39d !important;
}
#auth #codeForm .code-help {
  margin: 5px 0 0 !important;
  color: #7b806d !important;
  font-size: 10px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}
html[data-theme="dark"] body #auth #codeForm .code-help {
  color: #c5cdbd !important;
}

/* Two-position device slider: auto-selects from viewport, can be overridden. */
#auth #codeForm .code-device-control {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 0 12px !important;
  color: #69735f !important;
  font: 10px/1.2 var(--mc-font) !important;
}
html[data-theme="dark"] body #auth #codeForm .code-device-control {
  color: #d6ddcf !important;
}
#auth #codeForm input#codeDeviceMode {
  appearance: none !important;
  -webkit-appearance: none !important;
  flex: 0 0 64px !important;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 24px !important;
  min-height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
}
#auth #codeForm input#codeDeviceMode::-webkit-slider-runnable-track {
  height: 12px;
  border: 1px solid #78866d;
  border-radius: 999px;
  background: linear-gradient(90deg,#d9e3d1,#aab99e);
}
#auth #codeForm input#codeDeviceMode::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -5px;
  border: 2px solid #f5f2e8;
  border-radius: 50%;
  background: #647c5c;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
#auth #codeForm input#codeDeviceMode::-moz-range-track {
  height: 10px;
  border: 1px solid #78866d;
  border-radius: 999px;
  background: linear-gradient(90deg,#d9e3d1,#aab99e);
}
#auth #codeForm input#codeDeviceMode::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #f5f2e8;
  border-radius: 50%;
  background: #647c5c;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* Phone mode gives the registration/code page the full book width. */
#auth[data-device-mode="phone"] .auth-book.is-spread {
  width: min(540px,calc(100vw - 20px)) !important;
}
#auth[data-device-mode="phone"] .book-spread {
  grid-template-columns: minmax(0,1fr) !important;
}
#auth[data-device-mode="phone"] .book-page--spread-left {
  display: none !important;
}
#auth[data-device-mode="phone"] .book-page--spread-right {
  grid-column: 1 !important;
  border-left: 0 !important;
}
#auth[data-device-mode="phone"] #codeForm input#code {
  font-size: clamp(17px,4vw,20px) !important;
  letter-spacing: .10em !important;
}
#auth[data-device-mode="laptop"] #codeForm input#code {
  font-size: clamp(18px,2vw,22px) !important;
  letter-spacing: .14em !important;
}


/* AI moderation disclosure and appeal flow. */
#auth .auth-moderation-disclosure {
  margin: 10px 0 12px !important;
  padding: 8px 10px !important;
  border-left: 3px solid #b69a62 !important;
  color: #686c5b !important;
  background: rgba(182,154,98,.10) !important;
  font-size: 10px !important;
  line-height: 1.5 !important;
}
html[data-theme="dark"] body #auth .auth-moderation-disclosure {
  color: #d5d7c7 !important;
  background: rgba(182,154,98,.12) !important;
}
#auth .ban-appeal-panel {
  width: 100% !important;
  margin-top: 8px !important;
}
#auth .ban-appeal-info {
  padding: 12px !important;
  border: 1px solid #b99c69 !important;
  color: #59452f !important;
  background: #f0e7d4 !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
  overflow-wrap: anywhere !important;
}
html[data-theme="dark"] body #auth .ban-appeal-info {
  border-color: #806b4a !important;
  color: #eee4d0 !important;
  background: #40372b !important;
}
#auth .ban-appeal-form label {
  display:block !important;
  margin:10px 0 5px !important;
  color:inherit !important;
  font-size:11px !important;
}
#auth .ban-appeal-form textarea {
  width:100% !important;
  min-height:100px !important;
  padding:9px !important;
  border:2px solid #82735e !important;
  border-radius:0 !important;
  color:#352d24 !important;
  background:#fffdf5 !important;
  font:12px/1.5 system-ui,sans-serif !important;
  resize:vertical !important;
}
html[data-theme="dark"] body #auth .ban-appeal-form textarea {
  border-color:#626b60 !important;
  color:#f2eee3 !important;
  background:#252d28 !important;
}
#auth .ban-appeal-form button { margin-top:10px !important; }
#auth .ban-appeal-status {
  min-height:22px !important;
  margin:10px 0 0 !important;
  color:var(--muted) !important;
  font-size:11px !important;
}
#auth .book-actions:has(#bookSign[hidden]) { display:none !important; }
.moderation-notice {
  width:min(1180px,calc(100% - 32px));
  margin:12px auto 0;
  padding:9px 13px;
  border:1px solid rgba(159,132,82,.35);
  border-left:3px solid #a98d5c;
  color:var(--text);
  background:var(--surface);
  box-shadow:var(--shadow);
  font-size:11px;
  line-height:1.5;
}
.moderation-notice b { color:var(--text); }
.moderation-admin { margin:18px 0 !important; }
.moderation-admin h3 { margin:16px 0 8px !important; font-size:13px !important; }
.moderation-admin .data-row { gap:12px; }
@media(max-width:760px) {
  .moderation-notice { width:calc(100% - 18px); margin-top:8px; padding:8px 9px; font-size:10px; }
  #auth .auth-moderation-disclosure { font-size:8px !important; }
  #auth .ban-appeal-info { font-size:10px !important; }
}


/* Light theme: stronger text contrast and more comfortable reading sizes. */
:root[data-theme="light"] {
  --scrl-pastel-text: #26392b;
  --scrl-pastel-muted: #465b49;
  --scrl-pastel-choice-text: #334437;
  --scrl-pastel-gold-text: #42351a;
}
html[data-theme="light"] body #page {
  color: #26392b !important;
  font-size: 15px !important;
}
html[data-theme="light"] body #page p,
html[data-theme="light"] body #page li,
html[data-theme="light"] body #page .data-row,
html[data-theme="light"] body #page .activity-item,
html[data-theme="light"] body #page .notification-item,
html[data-theme="light"] body #page .chat-line {
  color: #26392b !important;
}
html[data-theme="light"] body #page .muted,
html[data-theme="light"] body #page .small,
html[data-theme="light"] body #page .section-hint,
html[data-theme="light"] body #page .demo-note,
html[data-theme="light"] body #page .data-row small,
html[data-theme="light"] body #page .demo-stat span,
html[data-theme="light"] body #page .demo-stat small,
html[data-theme="light"] body #page .activity-item small,
html[data-theme="light"] body #page .card-top .small,
html[data-theme="light"] body #page .chat-line small {
  color: #465b49 !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;
}
html[data-theme="light"] body #page label,
html[data-theme="light"] body #page .demo-form label {
  color: #334a38 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}
html[data-theme="light"] body #page input,
html[data-theme="light"] body #page select,
html[data-theme="light"] body #page textarea {
  color: #26392b !important;
  font-size: 14px !important;
}
html[data-theme="light"] body #page .button,
html[data-theme="light"] body #page .text-button,
html[data-theme="light"] body #page .more-menu button {
  color: #334437 !important;
  font-size: 13px !important;
}
html[data-theme="light"] body #page h1,
html[data-theme="light"] body #page h2,
html[data-theme="light"] body #page h3,
html[data-theme="light"] body .topbar,
html[data-theme="light"] body .more-menu {
  color: #26392b !important;
}
html[data-theme="light"] body #page .moderation-state {
  color: #344a37 !important;
  border: 1px solid #849a7e !important;
  background: #d6e3d1 !important;
  font-size: 12px !important;
}
html[data-theme="light"] body .moderation-notice[data-state="setup"] {
  color: #47391e !important;
  border-color: #b49a5b !important;
  background: #f3ecd7 !important;
}
html[data-theme="light"] body .moderation-notice[data-state="active"] {
  color: #2e4932 !important;
  border-color: #92ae8e !important;
  background: #e3eee0 !important;
}
html[data-theme="light"] body .moderation-status-line {
  color: #344a37 !important;
  font-size: 13px !important;
}
@media(max-width:760px) {
  html[data-theme="light"] body #page .muted,
  html[data-theme="light"] body #page .small,
  html[data-theme="light"] body #page .data-row small,
  html[data-theme="light"] body #page .activity-item small {
    font-size: 12px !important;
  }
}

/* ScRl responsive/accessibility pass. */
html, body { max-width:100%; overflow-x:clip; }
body, #app, #page, .page-wrap, .topbar-inner, #page > *,
#page .demo-card, #page .demo-form, #page .demo-stat, #page .match-box, #page .data-row { min-width:0; }
#page img, #page svg, #page video, #page canvas { max-width:100%; }
#page p, #page li, #page label, #page small, #page .data-row,
#page .card-top, #page .card-bottom { overflow-wrap:anywhere; }
#page input, #page select, #page textarea { box-sizing:border-box; width:100%; min-width:0; max-width:100%; }
#page .actions, #page .card-bottom, #page .card-top { flex-wrap:wrap; }
#page .actions { justify-content:flex-start; }
#page .data-row { flex-wrap:wrap; align-items:flex-start; gap:8px 12px; }
#page .data-row > :first-child { flex:1 1 180px; min-width:0; overflow-wrap:anywhere; }
#page .button, #page .text-button { max-width:100%; min-width:0; white-space:normal; overflow-wrap:anywhere; }
.logout-button {
 display:inline-flex !important; width:auto !important; min-width:68px !important;
 min-height:34px !important; height:34px !important; align-items:center !important; justify-content:center !important;
 padding:0 10px !important; border:2px solid var(--border) !important; border-radius:6px !important;
 transform:none !important; color:var(--text) !important; background:var(--surface) !important;
 font-size:13px !important; font-weight:700 !important; line-height:1 !important; white-space:nowrap !important;
}
.logout-button:hover { border-color:var(--accent) !important; background:var(--surface2) !important; }
.button-danger { border:2px solid #8c3939 !important; color:#fff !important; background:#9f3f3f !important; }
.account-danger { margin:24px 0 30px; padding:16px; border:2px solid #9e6760; background:color-mix(in srgb,#9e6760 8%,var(--surface)); border-radius:8px; }
.account-danger h2 { color:#9d4c43 !important; }
.account-danger p { margin:0 0 12px; color:var(--text); font-size:14px !important; line-height:1.6 !important; }
.account-delete-form { margin:12px 0 0 !important; padding:12px !important; border-color:#b47b71 !important; }
.account-delete-form label { font-size:13px !important; font-weight:700 !important; }

@media (min-width:1200px) and (max-width:1599px) {
 html body .page-wrap { width:min(calc(100% - 64px),1180px) !important; }
}
@media (min-width:1600px) {
 html body .page-wrap { width:min(calc(100% - 96px),1400px) !important; }
 html body #page .demo-list { grid-template-columns:repeat(3,minmax(0,1fr)) !important; }
 html body #page .home-overview { grid-template-columns:repeat(4,minmax(0,1fr)) !important; }
}
@media (max-width:1100px) {
 html body .topbar { height:auto !important; min-height:0 !important; }
 html body .topbar-inner {
  display:grid !important; grid-template-columns:max-content minmax(0,1fr) !important; grid-template-rows:auto auto !important;
  align-items:center !important; width:calc(100% - 28px) !important; height:auto !important; min-height:0 !important;
  gap:8px 12px !important; padding:8px 0 !important;
 }
 html body .brand { grid-column:1; grid-row:1; min-width:0 !important; }
 html body .topbar-actions {
  grid-column:2; grid-row:1; display:flex !important; width:100% !important; min-width:0 !important;
  align-items:center !important; justify-content:flex-end !important; flex-flow:row nowrap !important; gap:6px !important;
 }
 html body .main-nav {
  grid-column:1 / -1; grid-row:2; display:grid !important; grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  width:100% !important; min-width:0 !important; height:auto !important; min-height:0 !important;
  align-items:stretch !important; gap:6px !important; overflow:visible !important;
 }
 html body .main-nav .nav-tab {
  display:flex !important; width:100% !important; min-width:0 !important; min-height:40px !important; height:auto !important;
  align-items:center !important; justify-content:center !important; margin:0 !important; padding:6px 5px !important;
  font-size:clamp(10px,1.1vw,13px) !important; line-height:1.25 !important; text-align:center !important;
  white-space:normal !important; overflow-wrap:anywhere !important;
 }
 html body .topbar-user { gap:6px !important; margin-left:0 !important; }
 html body .user-name { max-width:120px !important; }
 html body #page .demo-columns { grid-template-columns:minmax(0,1fr) !important; gap:14px !important; }
 html body #page .demo-list { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:12px !important; }
 html body #page .demo-form { width:100% !important; max-width:none !important; }
}
@media (max-width:900px) {
 html body .page-wrap { width:calc(100% - 32px) !important; padding-top:24px !important; padding-bottom:44px !important; }
 html body #page .actions { max-width:100% !important; flex-wrap:wrap !important; gap:7px !important; }
 html body #page .filter-row { flex-wrap:wrap !important; }
 html body #page .filter-row input, html body #page .filter-row select { min-width:0 !important; flex:1 1 170px !important; }
}
@media (max-width:620px) {
 html body .topbar { height:auto !important; min-height:0 !important; }
 html body .topbar-inner {
  display:grid !important; grid-template-columns:minmax(0,1fr) !important; grid-template-rows:auto auto auto !important;
  width:calc(100% - 14px) !important; height:auto !important; min-height:0 !important; gap:6px !important; padding:6px 0 !important;
 }
 html body .brand { grid-column:1; grid-row:1; gap:5px !important; font-size:15px !important; }
 html body .brand-mark { width:30px !important; min-width:30px !important; height:30px !important; }
 html body .topbar-actions {
  grid-column:1; grid-row:2; display:flex !important; width:100% !important; min-width:0 !important;
  align-items:center !important; justify-content:space-between !important; gap:4px !important;
 }
 html body .main-nav {
  grid-column:1; grid-row:3; display:grid !important; grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  width:100% !important; min-width:0 !important; gap:3px !important;
 }
 html body .main-nav .nav-tab {
  min-width:0 !important; min-height:36px !important; padding:5px 2px !important;
  font-size:clamp(9px,2.6vw,11px) !important; line-height:1.15 !important; overflow-wrap:anywhere !important;
 }
 html body .topbar-user { display:flex !important; align-items:center !important; gap:3px !important; }
 html body .user-name { display:none !important; }
 html body .topbar-balance {
  display:inline-flex !important; width:74px !important; min-width:74px !important; max-width:74px !important;
  height:32px !important; min-height:32px !important; justify-content:center !important; gap:0 !important; padding:0 4px !important;
 }
 html body .balance-group--vrub, html body .balance-divider { display:none !important; }
 html body .balance-group--scrl { gap:4px !important; }
 html body .balance-group--scrl small { font-size:9px !important; }
 html body .balance-group--scrl strong { font-size:11px !important; }
 html body .more-btn { width:34px !important; min-width:34px !important; height:34px !important; min-height:34px !important; padding:0 !important; font-size:0 !important; }
 html body .more-btn span { font-size:12px !important; }
 html body .theme-btn { width:34px !important; min-width:34px !important; height:34px !important; min-height:34px !important; padding:0 !important; font-size:0 !important; }
 html body .theme-btn::after { content:"☀"; font:16px/1 sans-serif; }
 html[data-theme="light"] body .theme-btn::after { content:"☾"; }
 html body .user-avatar { width:26px !important; min-width:26px !important; height:26px !important; }
 html body .logout-button { width:48px !important; min-width:48px !important; height:32px !important; min-height:32px !important; padding:0 5px !important; font-size:11px !important; }
 html body .notification-bell { width:34px !important; min-width:34px !important; height:34px !important; min-height:34px !important; }
 html body .page-wrap { width:calc(100% - 22px) !important; padding-top:17px !important; padding-bottom:34px !important; }
 html body #page .demo-columns, html body #page .demo-list { grid-template-columns:minmax(0,1fr) !important; gap:10px !important; }
 html body #page .demo-stats { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; }
 html body #page .demo-stat { padding:11px 9px !important; }
 html body #page .demo-stat b { font-size:clamp(17px,5vw,22px) !important; overflow-wrap:anywhere !important; }
 html body #page h1 { font-size:clamp(23px,7vw,30px) !important; line-height:1.18 !important; }
 html body #page h2 { font-size:clamp(17px,5vw,21px) !important; line-height:1.25 !important; }
 html body #page .demo-card { padding:13px !important; }
 html body #page .demo-form { padding:13px 11px !important; }
 html body #page .button { width:auto !important; min-height:36px !important; padding:8px 10px !important; font-size:12px !important; }
 html body #page .demo-form > .button { width:100% !important; }
 html body #page .text-button { min-height:34px !important; padding:5px 7px !important; font-size:12px !important; }
 html body #page .msg-form { display:flex !important; min-width:0 !important; flex-wrap:wrap !important; gap:7px !important; }
 html body #page .msg-form input, html body #page .msg-form select { min-width:0 !important; flex:1 1 140px !important; }
 html body .more-menu { right:0 !important; min-width:min(205px,calc(100vw - 16px)) !important; max-width:calc(100vw - 16px) !important; }
 html body .notification-panel { right:0 !important; width:min(340px,calc(100vw - 16px)) !important; max-width:calc(100vw - 16px) !important; }
 html body #app:not([hidden]) ~ #toast { top:110px !important; right:8px !important; max-width:calc(100vw - 16px) !important; }
 html body #auth:not([hidden]) ~ #toast { top:8px !important; right:8px !important; max-width:calc(100vw - 16px) !important; }
 html body .account-danger { padding:12px !important; }
 html body .account-delete-form { padding:10px !important; }
}
@media (max-width:380px) {
 html body .topbar-inner { width:calc(100% - 10px) !important; gap:5px !important; }
 html body .topbar-actions { gap:2px !important; }
 html body .topbar-balance { width:68px !important; min-width:68px !important; max-width:68px !important; }
 html body .logout-button { width:44px !important; min-width:44px !important; font-size:10px !important; }
 html body .main-nav { gap:2px !important; }
 html body .main-nav .nav-tab { padding:4px 1px !important; font-size:9px !important; }
 html body #page .demo-stats { grid-template-columns:minmax(0,1fr) !important; }
 html body #page .msg-form { display:grid !important; grid-template-columns:minmax(0,1fr) !important; }
 html body #page .msg-form button { width:100% !important; }
}
html[data-theme="light"] body #page .muted,
html[data-theme="light"] body #page .small,
html[data-theme="light"] body #page .section-hint,
html[data-theme="light"] body #page .data-row small,
html[data-theme="light"] body #page .demo-stat span,
html[data-theme="light"] body #page .demo-stat small,
html[data-theme="light"] body #page .activity-item small { color:#405343 !important; }
html[data-theme="dark"] body #page .muted,
html[data-theme="dark"] body #page .small,
html[data-theme="dark"] body #page .section-hint,
html[data-theme="dark"] body #page .data-row small,
html[data-theme="dark"] body #page .demo-stat span,
html[data-theme="dark"] body #page .demo-stat small,
html[data-theme="dark"] body #page .activity-item small { color:#d6ded1 !important; }
html[data-theme="light"] body #auth .auth-moderation-disclosure,
html[data-theme="light"] body #auth .code-help,
html[data-theme="light"] body #auth .book-guide-item p { color:#465742 !important; font-size:12px !important; }
html[data-theme="dark"] body #auth .auth-moderation-disclosure,
html[data-theme="dark"] body #auth .code-help,
html[data-theme="dark"] body #auth .book-guide-item p { color:#e1e6d9 !important; font-size:12px !important; }
.auth-screen.is-closing .auth-book { filter:none !important; opacity:1 !important; transform:none !important; }
#app.is-entering, #app.is-entering.is-ready { opacity:1 !important; animation:none !important; transform:none !important; }


/* ScRl mobile and auth repair: exactly two single-page auth states. */
.brand-logo {
  display:block;
  width:34px;
  height:34px;
  flex:0 0 34px;
  object-fit:contain;
  image-rendering:auto;
}
.currency-coin-icon {
  display:inline-block;
  width:17px;
  height:17px;
  flex:0 0 17px;
  vertical-align:middle;
  object-fit:contain;
  image-rendering:auto;
}
.currency-coin-icon--inline { margin:0 3px; }

#auth .auth-stage {
  width:min(100%,540px) !important;
  gap:12px !important;
  perspective:none !important;
}
#auth .auth-book {
  width:min(100%,520px) !important;
  height:min(700px,calc(100svh - 150px)) !important;
  min-height:min(480px,calc(100svh - 150px)) !important;
  padding:10px !important;
  border:3px solid #291710 !important;
  border-radius:10px !important;
  transform:none !important;
  transform-style:flat !important;
}
#auth .book-page-stack,
#auth .auth-book::before,
#auth .auth-book::after {
  display:none !important;
}
#auth .book-page,
#auth .book-page--single,
#auth .book-page--registration {
  position:absolute !important;
  inset:8px !important;
  display:flex !important;
  flex-direction:column !important;
  width:auto !important;
  height:auto !important;
  min-width:0 !important;
  min-height:0 !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  padding:24px 30px 22px !important;
  border:1px solid #c6b491 !important;
  border-radius:5px !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transform:translateX(10px) !important;
  transition:opacity .18s ease,transform .2s ease,visibility 0s linear .2s !important;
  scrollbar-width:thin;
  overscroll-behavior:contain;
}
#auth .book-page::before,
#auth .book-page::after {
  display:none !important;
  content:none !important;
}
#auth .auth-book:not(.is-spread) #loginPage,
#auth .auth-book.is-spread #registrationPage {
  z-index:2 !important;
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
  transform:translateX(0) !important;
  transition:opacity .18s ease,transform .2s ease,visibility 0s !important;
}
#auth .auth-book.is-spread #loginPage {
  z-index:1 !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transform:translateX(-10px) !important;
}
#auth .book-page-top {
  min-height:22px !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:8px !important;
  margin:0 0 18px !important;
  padding:0 0 9px !important;
  font-size:12px !important;
}
#auth .page-counter {
  font-size:12px !important;
  line-height:1.4 !important;
}
#auth .book-title {
  margin:0 0 9px !important;
  font-size:clamp(22px,4vw,28px) !important;
  line-height:1.35 !important;
}
#auth .book-subtitle {
  margin:0 0 15px !important;
  font-size:13px !important;
  line-height:1.55 !important;
}
#auth .auth-moderation-disclosure {
  margin:0 0 12px !important;
  font-size:11px !important;
  line-height:1.5 !important;
  overflow-wrap:anywhere !important;
}
#auth .book-page .book-form {
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}
#auth .book-page .book-form label {
  margin:8px 0 4px !important;
  font-size:13px !important;
  line-height:1.4 !important;
}
#auth .book-page .book-form .mc-input-shell {
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:hidden !important;
}
#auth .book-page .book-form input {
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  min-height:42px !important;
  margin:0 !important;
  padding:8px 10px !important;
  font-size:14px !important;
  line-height:1.4 !important;
  overflow:hidden !important;
  text-overflow:clip !important;
}
#auth .book-page .book-form--registration label {
  margin:5px 0 3px !important;
  font-size:12.5px !important;
}
#auth .book-page .book-form--registration input {
  min-height:40px !important;
  padding:7px 9px !important;
  font-size:14px !important;
}
#auth .book-page .book-form .form-error {
  min-height:16px !important;
  margin:4px 0 0 !important;
  font-size:11px !important;
  line-height:1.4 !important;
  overflow-wrap:anywhere !important;
}
#auth #registrationPage .book-copy {
  margin-bottom:8px !important;
}
#auth #registrationPage .book-copy--registration .book-title {
  font-size:clamp(21px,3.7vw,26px) !important;
}
#auth .book-page-link,
#auth .book-inline-link {
  max-width:100% !important;
  margin-top:10px !important;
  padding:7px 0 2px !important;
  font-size:12px !important;
  line-height:1.5 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}
#auth #registrationPage #backToLogin {
  position:static !important;
  display:grid !important;
  width:32px !important;
  min-width:32px !important;
  height:32px !important;
  place-items:center !important;
  margin-left:auto !important;
  font-size:22px !important;
}
#auth #registrationPage .book-page-top { padding-right:0 !important; }
#auth .code-info { font-size:13px !important; line-height:1.55 !important; }
#auth #codeForm input#code {
  min-height:48px !important;
  padding:9px 8px !important;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif !important;
  font-size:clamp(18px,4vw,22px) !important;
  text-align:center !important;
}
#auth .book-actions {
  display:grid !important;
  width:min(100%,440px) !important;
  grid-template-columns:minmax(0,1fr) !important;
  gap:0 !important;
}
#auth .book-action-button {
  width:100% !important;
  min-height:46px !important;
  font-size:13px !important;
}
#auth .book-spread,
#auth .book-page--spread-left,
#auth .book-page--spread-right { display:none !important; }

/* The underscore caret follows the real browser text layout, not estimated glyph widths. */
.mc-caret-measure {
  position:absolute !important;
  z-index:-1 !important;
  display:block !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  white-space:pre !important;
  visibility:hidden !important;
  pointer-events:none !important;
  border:0 !important;
  margin:0 !important;
  color:transparent !important;
}
.mc-caret-marker {
  display:inline-block !important;
  width:0 !important;
  min-width:0 !important;
  height:1em !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  vertical-align:baseline !important;
}

/* Phone/tablet header: keep the complete ЕЩЁ label and every action inside the viewport. */
@media (max-width:1100px) {
  html body .topbar-inner {
    grid-template-columns:max-content minmax(0,1fr) !important;
    grid-template-rows:auto auto !important;
    gap:8px 10px !important;
  }
  html body .topbar-actions {
    min-width:0 !important;
    gap:5px !important;
    justify-content:flex-end !important;
  }
  html body .more-wrap { flex:0 0 auto !important; margin:0 !important; }
  html body .more-btn {
    width:auto !important;
    min-width:56px !important;
    padding:0 7px !important;
    font-size:10px !important;
    white-space:nowrap !important;
  }
  html body .more-btn span { font-size:10px !important; }
  html body .main-nav .nav-tab { white-space:normal !important; }
}
@media (max-width:620px) {
  html body .topbar-inner {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    grid-template-rows:auto auto auto !important;
    width:calc(100% - 12px) !important;
    gap:6px !important;
    padding:7px 0 !important;
  }
  html body .brand {
    grid-column:1 !important;
    grid-row:1 !important;
    gap:6px !important;
    font-size:15px !important;
  }
  html body .brand-logo {
    width:30px !important;
    height:30px !important;
    flex-basis:30px !important;
  }
  html body .topbar-actions {
    grid-column:1 !important;
    grid-row:2 !important;
    display:flex !important;
    width:100% !important;
    min-width:0 !important;
    align-items:center !important;
    justify-content:space-between !important;
    flex-flow:row nowrap !important;
    gap:3px !important;
  }
  html body .more-wrap { flex:0 0 auto !important; }
  html body .more-btn {
    width:auto !important;
    min-width:52px !important;
    max-width:none !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 6px !important;
    font-size:10px !important;
    line-height:1 !important;
    white-space:nowrap !important;
  }
  html body .more-btn span { display:inline !important; font-size:9px !important; }
  html body .topbar-balance {
    display:inline-flex !important;
    flex:0 1 88px !important;
    width:88px !important;
    min-width:80px !important;
    max-width:88px !important;
    height:34px !important;
    min-height:34px !important;
    justify-content:center !important;
    gap:3px !important;
    padding:0 4px !important;
  }
  html body .balance-group--vrub,
  html body .balance-divider { display:none !important; }
  html body .balance-group--scrl {
    display:inline-flex !important;
    align-items:center !important;
    gap:3px !important;
    white-space:nowrap !important;
  }
  html body .balance-group--scrl small { font-size:9px !important; }
  html body .balance-group--scrl strong { font-size:10px !important; }
  html body .currency-coin-icon { width:14px !important; height:14px !important; flex-basis:14px !important; }
  html body .topbar-user {
    display:flex !important;
    flex:0 0 auto !important;
    align-items:center !important;
    gap:3px !important;
    margin:0 !important;
  }
  html body .user-name { display:none !important; }
  html body .theme-btn {
    display:inline-flex !important;
    width:32px !important;
    min-width:32px !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 !important;
    font-size:0 !important;
  }
  html body .theme-btn::after {
    content:"☀";
    font:15px/1 sans-serif;
  }
  html[data-theme="light"] body .theme-btn::after { content:"☾"; }
  html body .user-avatar {
    width:26px !important;
    min-width:26px !important;
    height:26px !important;
    font-size:10px !important;
  }
  html body .logout-button {
    width:46px !important;
    min-width:46px !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 4px !important;
    font-size:10px !important;
  }
  html body .notification-wrap { flex:0 0 auto !important; }
  html body .notification-bell {
    width:32px !important;
    min-width:32px !important;
    height:34px !important;
    min-height:34px !important;
  }
  html body .main-nav {
    grid-column:1 !important;
    grid-row:3 !important;
    display:grid !important;
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    width:100% !important;
    min-width:0 !important;
    gap:3px !important;
    overflow:visible !important;
  }
  html body .main-nav .nav-tab {
    display:flex !important;
    min-width:0 !important;
    min-height:40px !important;
    padding:5px 2px !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:clamp(9px,2.65vw,11px) !important;
    line-height:1.2 !important;
    text-align:center !important;
    overflow-wrap:anywhere !important;
  }
  html body .page-wrap {
    width:calc(100% - 16px) !important;
    padding:16px 0 32px !important;
  }
  html body #page { min-width:0 !important; }
  html body #page > * { min-width:0 !important; max-width:100% !important; }
  html body #page h1 { font-size:clamp(22px,6.8vw,29px) !important; line-height:1.25 !important; }
  html body #page h2 { font-size:clamp(17px,5vw,21px) !important; line-height:1.3 !important; }
  html body #page p, html body #page li { font-size:13px !important; line-height:1.55 !important; }
  html body #page .demo-form,
  html body #page .demo-card,
  html body #page .match-box { padding:12px !important; }
  html body #page .demo-form input,
  html body #page .demo-form select,
  html body #page .demo-form textarea,
  html body #page .filter-row input,
  html body #page .filter-row select,
  html body #page .msg-form input,
  html body #page .msg-form select {
    box-sizing:border-box !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    min-height:42px !important;
    font-size:16px !important;
  }
  html body #page .filter-row {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:8px !important;
  }
  html body #page .filter-row > * { width:100% !important; min-width:0 !important; }
  html body #page .demo-form > .button { width:100% !important; min-height:42px !important; }
  html body #page .actions { display:flex !important; flex-wrap:wrap !important; gap:6px !important; }
  html body #page .button,
  html body #page .text-button { min-height:38px !important; max-width:100% !important; white-space:normal !important; }
  html body #page table { display:block !important; max-width:100% !important; overflow-x:auto !important; }
  html body .more-menu {
    right:0 !important;
    min-width:min(220px,calc(100vw - 16px)) !important;
    max-width:calc(100vw - 16px) !important;
  }
  html body .notification-panel {
    right:0 !important;
    width:min(340px,calc(100vw - 16px)) !important;
    max-width:calc(100vw - 16px) !important;
  }

  #auth .auth-screen { padding:54px 10px 18px !important; }
  #auth .auth-stage { width:100% !important; max-width:460px !important; gap:10px !important; }
  #auth .auth-book {
    width:100% !important;
    height:min(720px,calc(100svh - 166px)) !important;
    min-height:min(430px,calc(100svh - 166px)) !important;
    padding:7px !important;
  }
  #auth .book-page,
  #auth .book-page--single,
  #auth .book-page--registration {
    inset:6px !important;
    padding:19px 17px 18px !important;
  }
  #auth .book-page-top { margin-bottom:13px !important; }
  #auth .book-title { font-size:clamp(21px,6vw,25px) !important; }
  #auth .book-subtitle { margin-bottom:12px !important; font-size:13px !important; }
  #auth .auth-moderation-disclosure { font-size:11px !important; line-height:1.45 !important; }
  #auth .book-page .book-form label,
  #auth .book-page .book-form--registration label {
    margin:6px 0 3px !important;
    font-size:12px !important;
  }
  #auth .book-page .book-form input,
  #auth .book-page .book-form--registration input {
    min-height:42px !important;
    padding:8px 9px !important;
    font-size:16px !important;
  }
  #auth .book-page .book-form .form-error { font-size:12px !important; }
  #auth .book-page-link,
  #auth .book-inline-link { font-size:12px !important; }
  #auth .book-actions { width:100% !important; max-width:460px !important; }
  #auth .book-action-button { min-height:44px !important; font-size:13px !important; }
}
@media (max-width:380px) {
  html body .topbar-inner { width:calc(100% - 10px) !important; }
  html body .more-btn { min-width:49px !important; padding:0 4px !important; font-size:9px !important; }
  html body .topbar-balance { flex-basis:78px !important; width:78px !important; min-width:76px !important; padding:0 2px !important; }
  html body .topbar-actions { gap:2px !important; }
  html body .logout-button { width:42px !important; min-width:42px !important; font-size:9px !important; }
  html body .notification-bell { width:30px !important; min-width:30px !important; }
  html body .main-nav .nav-tab { padding:4px 1px !important; font-size:9px !important; }
  #auth .book-page,
  #auth .book-page--single,
  #auth .book-page--registration { padding-left:13px !important; padding-right:13px !important; }
}
@media (max-height:690px) {
  #auth .auth-book {
    height:calc(100svh - 148px) !important;
    min-height:380px !important;
  }
  #auth .book-page,
  #auth .book-page--single,
  #auth .book-page--registration { padding-top:14px !important; padding-bottom:12px !important; }
  #auth .book-page-top { margin-bottom:9px !important; }
}


/* Transparent ScRl images: crop their empty canvas and give them a clear frame. */
.brand-logo-frame {
  position:relative; display:block; width:44px; height:44px; flex:0 0 44px;
  overflow:hidden; border:2px solid #536d4d; border-radius:3px;
  background:linear-gradient(145deg,#fbfdec,#e4edcf);
  box-shadow:0 3px 0 rgba(22,38,24,.42),inset 0 1px 0 rgba(255,255,255,.95),0 0 0 2px rgba(222,239,198,.55);
}
.brand-logo {
  position:absolute; display:block; width:100%; height:100%; max-width:none !important;
  inset:0; object-fit:contain; transform:scale(1.9); image-rendering:auto;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
.currency-coin-frame {
  display:inline-grid; width:27px; height:27px; flex:0 0 27px; place-items:center;
  overflow:hidden; border:1px solid #647d59; border-radius:50%;
  background:linear-gradient(145deg,#fffef4,#dfe9cf);
  box-shadow:0 2px 0 rgba(24,44,26,.38),0 0 0 2px rgba(240,247,223,.75);
  vertical-align:middle;
}
.currency-coin-icon {
  display:block; width:100%; height:100%; max-width:none !important; flex:0 0 auto;
  object-fit:cover; object-position:center; image-rendering:auto;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.5));
}
.currency-coin-frame--inline { margin:0 4px; }
.currency-coin-icon--inline { margin:0; }
html[data-theme="dark"] body .brand-logo-frame {
  border-color:#8ba77b; background:linear-gradient(145deg,#f4f6e8,#d9e5c5);
  box-shadow:0 3px 0 rgba(0,0,0,.55),0 0 0 2px rgba(214,229,190,.2);
}
html[data-theme="dark"] body .currency-coin-frame {
  border-color:#b5c89a; background:linear-gradient(145deg,#f4f6e8,#ceddb8);
  box-shadow:0 2px 0 rgba(0,0,0,.55),0 0 0 2px rgba(214,229,190,.15);
}

/* Lighter neutral-grey labels in the light theme, while keeping them readable. */
html[data-theme="light"] body #page .muted,
html[data-theme="light"] body #page .small,
html[data-theme="light"] body #page .section-hint,
html[data-theme="light"] body #page .data-row small,
html[data-theme="light"] body #page .demo-stat span,
html[data-theme="light"] body #page .demo-stat small,
html[data-theme="light"] body #page .activity-item small {
  color:#596b61 !important;
}
html[data-theme="light"] body #auth .auth-moderation-disclosure,
html[data-theme="light"] body #auth .code-help,
html[data-theme="light"] body #auth .book-guide-item p {
  color:#596b61 !important;
}

/* Parent is a non-persistent preview for the signed-in administrator only. */
#page .parent-preview-panel {
  margin:18px 0; padding:18px; border:2px solid var(--border);
  background:var(--surface); box-shadow:0 4px 0 rgba(0,0,0,.12);
}
#page .parent-preview-panel .parent-preview-status {
  display:inline-flex; align-items:center; gap:7px; margin:0 0 12px; padding:5px 9px;
  border:1px solid var(--border); background:var(--surface2); color:var(--muted); font-size:12px;
}
#page .parent-preview-panel .button { margin-top:15px; }
@media (max-width:620px) {
  html body .brand-logo-frame { width:40px; height:40px; flex-basis:40px; }
  html body .currency-coin-frame { width:24px; height:24px; flex-basis:24px; }
}


/* Readable metadata and consistent vertical alignment for identity/currency. */
html body #page .small,
html body #page .muted,
html body #page .section-hint,
html body #page .demo-note,
html body #page .data-row small,
html body #page .demo-stat span,
html body #page .demo-stat small,
html body #page .card-top .small,
html body #page .activity-item small,
html body #page .chat-line small,
html body #page .moderation-state {
  font-size:14px !important;
  line-height:1.6 !important;
}
html body #page .eyebrow { font-size:13px !important; line-height:1.5 !important; }
html body #page label,
html body #page .demo-form label,
html body #page .account-delete-form label { font-size:14px !important; line-height:1.5 !important; }
html body .brand {
  display:inline-flex !important;
  align-items:center !important;
  line-height:1 !important;
}
html body .brand-logo-frame {
  display:grid !important;
  flex:0 0 44px !important;
  align-self:center !important;
  place-items:center !important;
  vertical-align:middle !important;
}
html body .topbar-balance,
html body .balance-group {
  display:inline-flex !important;
  align-items:center !important;
}
html body .currency-coin-frame {
  display:inline-grid !important;
  flex:0 0 27px !important;
  align-self:center !important;
  place-items:center !important;
  margin-top:0 !important;
  margin-bottom:0 !important;
  vertical-align:middle !important;
}
html body .currency-coin-icon {
  display:block !important;
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
}
#auth .auth-moderation-disclosure,
#auth .code-help,
#auth .ban-appeal-status,
#auth .book-page .code-info,
#auth .book-page .ban-appeal-info {
  font-size:12px !important;
  line-height:1.55 !important;
}
@media (max-width:760px) {
  html body #page .small,
  html body #page .muted,
  html body #page .section-hint,
  html body #page .demo-note,
  html body #page .data-row small,
  html body #page .demo-stat span,
  html body #page .demo-stat small,
  html body #page .card-top .small,
  html body #page .activity-item small,
  html body #page .chat-line small,
  html body #page .moderation-state {
    font-size:13px !important;
    line-height:1.55 !important;
  }
  #auth .auth-moderation-disclosure,
  #auth .code-help,
  #auth .ban-appeal-status { font-size:11px !important; }
}


/* Keep flex bases in sync with the smaller image frames on phones. */
@media (max-width:620px) {
  html body .brand-logo-frame {
    width:40px !important;
    height:40px !important;
    flex-basis:40px !important;
  }
  html body .currency-coin-frame {
    width:24px !important;
    height:24px !important;
    flex-basis:24px !important;
  }
}


/* ScRl auth: turn from page 1 to page 2 without resizing the book. */
#auth .auth-book {
  perspective: 1500px !important;
  transform-style: preserve-3d !important;
  transition: box-shadow .3s ease !important;
}
#auth .book-page {
  transform-origin: left center !important;
  backface-visibility: hidden !important;
  transform-style: preserve-3d !important;
  transition: transform .72s cubic-bezier(.2,.75,.16,1) !important;
  will-change: transform;
}
#auth .auth-book:not(.is-spread) #loginPage {
  z-index: 3 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: rotateY(0deg) !important;
}
#auth .auth-book:not(.is-spread) #registrationPage {
  z-index: 2 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
  transform: rotateY(0deg) !important;
}
#auth .auth-book.is-spread #loginPage {
  z-index: 3 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
  transform: rotateY(-180deg) !important;
}
#auth .auth-book.is-spread #registrationPage {
  z-index: 2 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: rotateY(0deg) !important;
}

/* Keep the exact same responsive dimensions on both sides of the page turn. */
#auth .auth-book.is-spread,
#auth[data-device-mode="phone"] .auth-book.is-spread {
  width: min(100%,520px) !important;
  height: min(700px,calc(100svh - 150px)) !important;
  min-height: min(480px,calc(100svh - 150px)) !important;
}
@media (max-width:760px) {
  #auth .auth-book,
  #auth .auth-book.is-spread,
  #auth[data-device-mode="phone"] .auth-book.is-spread {
    width: 100% !important;
    height: min(720px,calc(100svh - 166px)) !important;
    min-height: min(430px,calc(100svh - 166px)) !important;
  }
}
@media (max-height:690px) {
  #auth .auth-book,
  #auth .auth-book.is-spread,
  #auth[data-device-mode="phone"] .auth-book.is-spread {
    height: calc(100svh - 148px) !important;
    min-height: 380px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #auth .book-page { transition: none !important; will-change: auto; }
}
