:root {
  --bg: #232b34;
  --bg-deep: #1c232b;
  --surface: #2b3540;
  --surface-2: #33404c;
  --line: #3e4b59;
  --text: #e8edf2;
  --muted: #a9b5c1;
  --blue: #1f9dff;
  --blue-deep: #0a78cc;
  --plate-light: #f1f4f7;
  --plate-dark: #c9d2db;
  --radius: 12px;
  --shadow: 0 14px 34px rgba(8, 12, 18, 0.38);
  --wide: 1200px;
  --mono: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.has-player { padding-bottom: 250px; }

img { max-width: 100%; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: 0.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.05rem; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--plate-light);
  color: #111;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { left: 8px; }

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

.plate {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--plate-light), var(--plate-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 1px solid #aab4be;
  flex: none;
}
.plate img { width: 44px; height: 44px; }
.plate-small { width: 46px; height: 46px; }
.plate-small img { width: 36px; height: 36px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(28, 35, 43, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand-name {
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav .lang-switch {
  margin-left: 8px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.menu-toggle {
  display: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 980px) {
  .menu-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav .lang-switch { margin: 8px 0 0; text-align: center; }
  .brand-name { font-size: 0.8rem; letter-spacing: 0.1em; }
}

main { flex: 1; width: 100%; }

.page-body {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 36px 20px 56px;
}

.calm { position: relative; }

.prose { max-width: 760px; }
.prose p, .prose li { color: #d6dde4; font-size: 1.05rem; }

.kicker {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button {
  display: inline-block;
  background: var(--blue-deep);
  color: #fff;
  border: 1px solid var(--blue);
  border-radius: 9px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.button:hover { background: var(--blue); text-decoration: none; transform: translateY(-1px); }
.button-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.button-ghost:hover { background: var(--surface-2); }
.button-disabled, .button-disabled:hover {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
  cursor: default;
  transform: none;
}

.code-bg, .code-static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, #2c3743 0%, var(--bg-deep) 70%);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  position: relative;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 54px 20px 64px;
  text-align: center;
}

.hero-logo {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
}
.hero-logo::before {
  content: '';
  position: absolute;
  inset: -90px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(238, 242, 246, 0.97) 0%,
    rgba(228, 234, 240, 0.93) 30%,
    rgba(206, 216, 226, 0.62) 48%,
    rgba(160, 175, 190, 0.26) 66%,
    rgba(110, 125, 140, 0.08) 82%,
    rgba(110, 125, 140, 0) 100%);
}
.hero-logo img { position: relative; width: 240px; height: 240px; }

.hero h1 { position: relative; margin-top: 26px; }
.hero-lead { position: relative; }
.hero-lead { color: var(--muted); font-size: 1.15rem; max-width: 640px; margin: 0 auto; }

.carousel {
  max-width: var(--wide);
  margin: 36px auto 0;
  padding: 0 20px;
}

.carousel-track {
  position: relative;
  display: flex;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
  touch-action: pan-y;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  min-height: 340px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 36px 44px;
  transition: transform 0.5s ease;
  overflow: hidden;
}

.slide-text { position: relative; max-width: 560px; }
.slide-text p { color: #d3dbe3; }
.slide-kicker {
  color: var(--blue) !important;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.slide-status { font-size: 0.92rem; color: var(--muted) !important; }

.slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide-mnema::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 26, 33, 0.94) 0%, rgba(20, 26, 33, 0.78) 45%, rgba(20, 26, 33, 0.1) 100%);
}
.slide-mnema .slide-text { z-index: 1; }

.slide-cover {
  width: 260px;
  height: 260px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  flex: none;
}

.slide-collage {
  display: grid;
  grid-template-columns: repeat(2, 130px);
  gap: 10px;
  flex: none;
}
.slide-collage img { width: 130px; height: 130px; border-radius: 8px; }

.slide-bee {
  background:
    radial-gradient(ellipse at 85% 50%, rgba(31, 157, 255, 0.22), transparent 60%),
    var(--surface);
}

.carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.carousel-controls button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 38px;
  height: 34px;
  font: inherit;
  cursor: pointer;
}
.carousel-dots { display: flex; gap: 8px; }
.carousel-dots button {
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 50%;
  background: var(--line);
  border: none;
}
.carousel-dots button[aria-current='true'] { background: var(--blue); }

@media (max-width: 720px) {
  .slide-mnema::after { background: linear-gradient(180deg, rgba(20, 26, 33, 0.94) 0%, rgba(20, 26, 33, 0.8) 55%, rgba(20, 26, 33, 0.25) 100%); }
  .hero-logo { width: 240px; height: 240px; }
  .hero-logo img { width: 200px; height: 200px; }
  .hero-logo::before { inset: -60px; }
  .slide { flex-direction: column; align-items: flex-start; padding: 26px 22px; min-height: 0; }
  .slide-cover { width: 180px; height: 180px; }
  .slide-collage { grid-template-columns: repeat(4, 64px); }
  .slide-collage img { width: 64px; height: 64px; }
}

.tiles {
  max-width: var(--wide);
  margin: 40px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 170px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}
.tile:hover { text-decoration: none; border-color: var(--blue); transform: translateY(-2px); }
.tile-title { position: relative; font-size: 1.25rem; font-weight: 700; }
.tile-text { position: relative; color: var(--muted); font-size: 0.95rem; }

@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 120px; }
}

.page-head {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-deep), #212932);
  border-bottom: 1px solid var(--line);
}
.page-head-inner {
  position: relative;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 44px 20px 36px;
}
.page-head-inner p:last-child { color: var(--muted); max-width: 680px; margin: 0; font-size: 1.08rem; }

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.game-card-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card-text { padding: 28px 30px; }
.game-emblem { width: 64px; height: auto; float: right; margin-left: 12px; }
.facts { color: var(--muted); padding-left: 20px; }
.game-note { color: var(--muted); font-size: 0.9rem; margin: 14px 0 0; }
.game-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.more-soon { color: var(--muted); text-align: center; margin-top: 28px; }

@media (max-width: 820px) { .game-card { grid-template-columns: 1fr; } }

.upcoming, .library { margin-bottom: 34px; }

.upcoming-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.genre-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 22px; }
.chip {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 0.92rem;
}
.chip:hover { color: var(--text); text-decoration: none; border-color: var(--blue); }
.chip.active { color: #fff; background: var(--blue-deep); border-color: var(--blue); }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 22px;
}

.album h3 { margin: 10px 0 2px; font-size: 1rem; }
.album-genres { margin: 0; color: var(--muted); font-size: 0.85rem; }

.album-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.album-open img { display: block; width: 100%; height: auto; aspect-ratio: 1; transition: transform 0.3s; }
.album-open:hover img { transform: scale(1.04); }
.album-upcoming .album-open img { filter: saturate(0.55) brightness(0.62); }

.badge {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: rgba(20, 26, 33, 0.88);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: left;
}
.badge-live { right: auto; background: var(--blue-deep); border-color: var(--blue); color: #fff; }

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

.youtube-note { color: var(--muted); font-size: 0.9rem; }
.youtube-note.small { font-size: 0.82rem; margin-top: 8px; }

.album-dialog {
  width: min(940px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.album-dialog::backdrop { background: rgba(10, 14, 19, 0.72); }
.album-dialog-body { padding: 28px; }
.dialog-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 12px 12px 0 0;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  z-index: 1;
}

.album-detail { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; }
.album-detail-cover { width: 300px; height: 300px; border-radius: 10px; box-shadow: var(--shadow); }
.album-detail-text p { color: #d6dde4; }
.album-detail-status { color: var(--muted) !important; font-size: 0.92rem; }
.album-detail-lead { font-weight: 600; color: var(--text) !important; }
.album-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.glossary { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; }
.glossary summary { cursor: pointer; font-weight: 600; }

@media (max-width: 760px) {
  .album-detail { grid-template-columns: 1fr; }
  .album-detail-cover { width: 200px; height: 200px; }
  .album-dialog-body { padding: 18px; }
}

.service-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--blue);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: 0 0 0 rgba(31, 157, 255, 0);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.service-card:hover {
  text-decoration: none;
  border-color: var(--blue);
  box-shadow: 0 0 24px rgba(31, 157, 255, 0.18);
  transform: translateY(-2px);
}
.service-card.has-thumb { padding-top: 0; overflow: hidden; }
.service-thumb {
  display: block;
  width: calc(100% + 48px);
  max-width: none;
  height: auto;
  margin: 0 -24px 2px;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  opacity: 0.9;
  transition: opacity 0.2s;
}
.service-card:hover .service-thumb { opacity: 1; }
.service-card.has-thumb .service-icon { margin-top: -38px; position: relative; background: var(--surface); }
.service-card h2 { margin: 6px 0 0; font-size: 1.3rem; }
.service-card p { margin: 0; color: #d0d8e0; flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.tech {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #cfd8e1;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
}

.cta-band {
  margin-top: 40px;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 90% 50%, rgba(31, 157, 255, 0.2), transparent 60%),
    var(--surface);
}
.cta-band p { color: #d0d8e0; }

.service-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(300px, 36vw, 520px);
  display: flex;
  align-items: flex-end;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.service-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 35, 43, 0.15) 0%, rgba(28, 35, 43, 0.55) 55%, rgba(35, 43, 52, 0.96) 100%);
  pointer-events: none;
}
.service-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 30px;
}
.service-hero-inner h1 { margin: 14px 0 0; }
.back-link { display: table; color: var(--muted); margin-bottom: 18px; font-size: 0.92rem; }
.back-link:hover { color: var(--text); }

.service-body { max-width: 980px; }
.service-intro { font-size: 1.2rem; color: #e1e7ed; margin-top: 0; }

.service-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0 36px; }
.service-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.service-box p:last-child { margin: 0; color: #d6dde4; }
.service-box-result { border-color: rgba(31, 157, 255, 0.45); }

.steps { list-style: none; padding: 0; margin: 0 0 34px; display: grid; gap: 12px; }
.step {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.step h3 { margin: 2px 0 4px; }
.step p { margin: 0; color: #d0d8e0; }
.step-number {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 700;
}

.other-services { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; }
.other-services .kicker { width: 100%; }
.other-services a { color: var(--muted); }
.other-services a:hover { color: var(--text); }

.slide-services {
  background:
    radial-gradient(ellipse at 80% 50%, rgba(31, 157, 255, 0.18), transparent 60%),
    var(--surface);
  justify-content: space-between;
}
.slide-icons { display: grid; grid-template-columns: repeat(3, 64px); gap: 14px; flex: none; }
.slide-icons .service-icon { width: 64px; height: 64px; }
.slide-icons .icon { width: 32px; height: 32px; }

@media (max-width: 720px) {
  .service-pair { grid-template-columns: 1fr; }
  .slide-icons { grid-template-columns: repeat(6, 40px); gap: 8px; }
  .slide-icons .service-icon { width: 40px; height: 40px; }
  .slide-icons .icon { width: 22px; height: 22px; }
  .service-hero { min-height: 260px; }
}

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.product-lead { font-weight: 600; }
.product-card p { color: #d6dde4; }
.product-soon { border-style: dashed; background: transparent; }
.product-soon p { color: var(--muted); }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.contact-card p, .contact-card address { color: #d6dde4; font-style: normal; }
.contact-mail { font-size: 1.15rem; font-weight: 600; }
.contact-mail.missing { color: var(--muted); font-style: italic; }

.error-page { text-align: center; padding-top: 80px; padding-bottom: 100px; }

.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 26px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}
.footer-brand { display: flex; gap: 14px; align-items: center; margin-right: auto; }
.footer-brand strong { color: var(--text); letter-spacing: 0.08em; }
.footer address { font-style: normal; line-height: 1.45; }
.footer p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-legal a { color: var(--muted); }
.footer-legal a:hover, .footer-legal a:focus-visible { color: var(--text); }

.legal-dialog { width: min(860px, calc(100vw - 24px)); }
.legal-doc { max-width: 780px; margin: 0 auto; line-height: 1.6; color: #d6dde4; }
.legal-doc h1 { margin: 0 0 6px; color: var(--text); }
.legal-doc h2 { margin: 28px 0 10px; color: var(--text); font-size: 1.25rem; }
.legal-doc h3 { margin: 20px 0 6px; color: var(--text); font-size: 1.05rem; }
.legal-doc strong { color: var(--text); }
.legal-doc hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.legal-doc ul { padding-left: 22px; }
.legal-doc li { margin: 4px 0; }
.legal-meta { color: var(--muted); font-size: 0.92rem; margin-top: 0; }
.legal-note { border-left: 3px solid var(--line); padding: 6px 12px; color: var(--muted); font-size: 0.92rem; }
.legal-missing { color: var(--muted); font-style: italic; }
.legal-table { overflow-x: auto; margin: 14px 0; }
.legal-table table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.legal-table th, .legal-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-table th { background: var(--surface-2); color: var(--text); }

.player {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 60;
  width: 380px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.player[hidden] { display: none; }
.player-frame { aspect-ratio: 16 / 9; background: #000; }
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-info { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.player-cover { width: 48px; height: 48px; border-radius: 6px; flex: none; }
.player-info div { flex: 1; min-width: 0; }
.player-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-yt { font-size: 0.85rem; }
.player-close {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 560px) {
  .player { left: 8px; right: 8px; bottom: 8px; width: auto; }
  body.has-player { padding-bottom: 330px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide, .tile, .button, .album-open img, .service-card { transition: none; }
}

.page-head-plain { background: linear-gradient(180deg, var(--bg-deep), var(--bg)); }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.panel-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 560px;
}
.panel-grid .panel-box { max-width: none; }
.panel-form { display: grid; gap: 10px; margin: 0 0 16px; }
.panel-form label { font-weight: 600; }
.panel-form input {
  font: inherit;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  width: 100%;
}
.panel-form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.panel-form .button { justify-self: start; }
.code-input { font-family: var(--mono); font-size: 1.3rem; letter-spacing: 0.2em; max-width: 14ch; }
.panel-note { color: var(--muted); font-size: 0.95rem; }
.signup-form { gap: 14px; }
.signup-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.5; }
.signup-check input { width: auto; margin-top: 4px; flex: none; }
.panel-inline { margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.notice {
  background: var(--surface-2);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 16px;
}
.notice-error { border-left-color: #ff8a65; }
.panel-steps { padding-left: 1.3em; margin: 0; }
.panel-steps li { margin-bottom: 18px; }
.qr { display: inline-block; background: #fff; padding: 12px; border-radius: 10px; line-height: 0; min-height: 40px; }
.qr img, .qr canvas { display: block; max-width: none; height: auto; }
.qr noscript p { line-height: 1.5; color: #333; }
.secret { font-family: var(--mono); font-size: 1.05rem; background: var(--bg-deep); padding: 6px 10px; border-radius: 6px; word-break: break-all; }
.backup-codes { columns: 2; padding-left: 1.6em; margin: 0 0 20px; font-family: var(--mono); font-size: 1.15rem; }
.backup-codes li { margin-bottom: 6px; }
.device-list { list-style: none; padding: 0; margin: 0 0 16px; }
.device-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.device-list small { color: var(--muted); }
.device-list form { margin: 0; }
.tag { display: inline-block; font-size: 0.78rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-left: 6px; color: var(--muted); }
.tag-ok { color: #8fd19e; border-color: #3d6b48; margin-left: 0; }
.tag-off { color: #e3a3a3; border-color: #7a4040; margin-left: 0; }
.button-small { padding: 5px 12px; font-size: 0.9rem; }
.admin { margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.admin-head h2 { margin: 0; }
.admin-head form { margin: 0 0 0 auto; }
.admin h3 { margin-top: 26px; }
.stats, .modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.stat, .module { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; }
.stat strong { font-size: 1.45rem; }
.stat span, .module span { color: var(--muted); font-size: 0.88rem; }
.module { border-style: dashed; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.login-link { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }

.chatsat { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 30px; }
@media (max-width: 560px) { body.has-player .chatsat { bottom: 330px; } }
.chatsat-launcher {
  position: relative; width: 70px; height: 70px; border-radius: 50%; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, var(--plate-light), var(--plate-dark) 70%, #97a3ae);
  border: 2px solid #8b98a5;
  box-shadow: 0 10px 26px rgba(8, 12, 18, 0.5), 0 0 0 0 rgba(31, 157, 255, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: chatsat-ring 3.2s ease-out infinite;
}
.chatsat-launcher:hover { transform: translateY(-2px) scale(1.04); }
.chatsat-launcher:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.chatsat.is-open .chatsat-launcher { animation: none; }

.chatsat-figure { position: relative; display: block; line-height: 0; }
.chatsat-figure img { display: block; width: 100%; height: auto; max-width: none; filter: drop-shadow(0 3px 4px rgba(8, 12, 18, 0.45)); }
.chatsat-figure-big { position: absolute; left: 50%; bottom: 3px; width: 61px; transform: translateX(-46%); }
.chatsat-figure-small { width: 26px; margin: 0 auto; }

.chatsat-visor { position: absolute; inset: 0; pointer-events: none; }
.chatsat-visor-h, .chatsat-visor-v, .chatsat-scan { position: absolute; border-radius: 2px; background: #5cbcff; mix-blend-mode: screen; }
.chatsat-visor-h { left: 21.6%; top: 47.3%; width: 37.3%; height: 3.7%; filter: blur(1.5px); }
.chatsat-visor-v { left: 38.2%; top: 50.8%; width: 3.5%; height: 23.9%; filter: blur(1.5px); }
.chatsat-visor-h, .chatsat-visor-v { animation: chatsat-glow 2.6s ease-in-out infinite; }
.chatsat-scan { left: 21.6%; top: 46.6%; width: 8%; height: 5%; background: #e6f6ff; opacity: 0; filter: blur(0.6px); box-shadow: 0 0 6px 2px #5cbcff; }
.chatsat.is-thinking .chatsat-visor-h, .chatsat.is-thinking .chatsat-visor-v { animation: none; opacity: 0.15; }
.chatsat.is-thinking .chatsat-scan { opacity: 1; animation: chatsat-scan 0.9s ease-in-out infinite alternate; }
@keyframes chatsat-glow { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.8; } }
@keyframes chatsat-scan { from { left: 21.6%; } to { left: 50.9%; } }
@keyframes chatsat-ring { 0% { box-shadow: 0 10px 26px rgba(8, 12, 18, 0.5), 0 0 0 0 rgba(31, 157, 255, 0.45); } 70%, 100% { box-shadow: 0 10px 26px rgba(8, 12, 18, 0.5), 0 0 0 14px rgba(31, 157, 255, 0); } }

.chatsat-panel {
  width: min(370px, calc(100vw - 32px)); height: min(540px, calc(100vh - 130px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.chatsat-panel[hidden] { display: none; }
.chatsat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-deep); border-bottom: 1px solid var(--line); }
.chatsat-head div { display: grid; line-height: 1.25; }
.chatsat-head small { color: var(--muted); }
.chatsat-badge { width: 40px; height: 40px; border-radius: 50%; padding: 3px 0 0; overflow: hidden; background: radial-gradient(circle at 35% 30%, var(--plate-light), var(--plate-dark) 70%, #97a3ae); flex: none; }
.chatsat-close { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
.chatsat-close:hover { color: var(--text); }
.chatsat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chatsat-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; line-height: 1.5; font-size: 0.95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.chatsat-bot { align-self: flex-start; background: var(--bg-deep); border: 1px solid var(--line); border-left: 3px solid var(--blue); }
.chatsat-user { align-self: flex-end; background: var(--blue-deep); color: #fff; }
.chatsat-wait { align-self: flex-start; color: var(--muted); font-style: italic; background: none; padding-left: 0; }
.chatsat-info { align-self: center; max-width: 100%; text-align: center; color: var(--muted); font-size: 0.88rem; background: var(--surface-2); }
.chatsat-msg a { color: #7cc4ff; }
.chatsat-user a { color: #fff; text-decoration: underline; }
.chatsat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chatsat-form input, .chatsat-mail-form input {
  flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--bg-deep);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
}
.chatsat-form input:focus, .chatsat-mail-form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.chatsat-mail { padding: 0 12px 4px; font-size: 0.88rem; }
.chatsat-mail-form, .chatsat-mail-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chatsat-mail-form[hidden], .chatsat-mail-confirm[hidden], .chatsat-mail-open[hidden] { display: none; }
.chatsat-mail-open:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.chatsat-note { margin: 0; padding: 4px 12px 10px; color: var(--muted); font-size: 0.78rem; }
@media (max-width: 520px) {
  .chatsat { right: 12px; bottom: 12px; }
  body.has-player .chatsat { bottom: 350px; }
  .chatsat-launcher { width: 60px; height: 60px; }
  .chatsat-figure-big { width: 53px; }
  .chatsat-panel { height: calc(100vh - 110px); }
}
@media (prefers-reduced-motion: reduce) {
  .chatsat-launcher, .chatsat-visor-h, .chatsat-visor-v, .chatsat.is-thinking .chatsat-scan { animation: none; }
}

.module-ready { border-style: solid; border-color: var(--blue-deep); color: var(--text); }
.module-ready:hover { background: var(--surface-2); text-decoration: none; }
.module-ready span { color: #7cc4ff; }
.stat-over { border-color: #ff8a65; }
.stat-over strong { color: #ff8a65; }
.tag-bad { border-color: #ff8a65; color: #ff8a65; }
.admin + .admin { margin-top: 20px; }
.admin textarea, .admin select, .setting-form input, .entry-form input {
  font: inherit; color: var(--text); background: var(--bg-deep);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
}
.admin textarea { width: 100%; resize: vertical; }
.entry { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: var(--bg-deep); }
.entry summary { cursor: pointer; font-weight: 600; }
.entry[open] summary { margin-bottom: 10px; }
.entry-form { max-width: 720px; }
.entry-form label { display: grid; gap: 4px; font-weight: 600; }
.entry-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.entry-row input[type=number] { width: 7em; }
.entry-form .check { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.setting-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.transcript { white-space: pre-wrap; font-family: inherit; font-size: 0.92rem; color: #d6dde4; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stat strong { white-space: nowrap; }

.period { display: flex; gap: 8px; margin-bottom: 16px; }
.period a { border: 1px solid var(--line); border-radius: 99px; padding: 4px 14px; color: var(--muted); }
.period a.active, .period a:hover { border-color: var(--blue); color: var(--text); text-decoration: none; }
.days { display: block; width: 100%; height: 70px; margin-top: 16px; }
.days rect { fill: var(--blue); opacity: 0.75; }
.days rect:hover { opacity: 1; }
.world { display: block; width: 100%; height: auto; background: #151b21; border-radius: 10px; border: 1px solid var(--line); }
.world .countries path { fill: #2a333d; stroke: #3c4955; stroke-width: 0.4; }
.world .countries path.lit { fill: #1f9dff; }
.world .countries path:hover { stroke: #9fd6ff; }
.world .ground { fill: #000; opacity: 0.35; }
.bld .wall { fill: #a9b5c1; }
.bld .roof { fill: #5d6b78; }
.bld .mast { stroke: #a9b5c1; stroke-width: 0.6; }
.bld .beacon { fill: #ff6b5a; animation: st-blink 1.6s ease-in-out infinite; }
.bld .win { fill: #ffd36b; animation: st-win 9s step-end infinite; }
.bld .win.off { fill: #3a4652; animation: none; }
.bld.d1 .win { animation-delay: -1s; } .bld.d2 .win { animation-delay: -2s; } .bld.d3 .win { animation-delay: -3s; }
.bld.d4 .win { animation-delay: -4s; } .bld.d5 .win { animation-delay: -5s; } .bld.d6 .win { animation-delay: -6s; }
.bld.d7 .win { animation-delay: -7s; } .bld.d8 .win { animation-delay: -8s; } .bld.d9 .win { animation-delay: -8.5s; }
.bld .win:nth-child(3n) { animation-duration: 13s; }
.bld .win:nth-child(4n+1) { animation-duration: 7s; }
@keyframes st-win { 0%, 88% { fill: #ffd36b; } 89%, 96% { fill: #8a7440; } }
@keyframes st-blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 12px; }
.map-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-bld { width: 16px; height: 34px; }
@media (prefers-reduced-motion: reduce) { .bld .win, .bld .beacon { animation: none; } }
.panel-box .table + h2, .panel-box .table + .panel-note + h2 { margin-top: 26px; }

.mail { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.mail-side { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.mail-side h3 { margin: 6px 0 0; font-size: 0.95rem; color: var(--muted); }
.mail-buckets, .mail-boxes { display: grid; gap: 4px; }
.mail-buckets a, .mail-boxes a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--text); border: 1px solid transparent; }
.mail-boxes a { align-items: flex-start; }
.mail-buckets a:hover, .mail-boxes a:hover { background: var(--surface-2); text-decoration: none; }
.mail-buckets a.active, .mail-boxes a.active { border-color: var(--blue-deep); background: var(--bg-deep); }
.mail-buckets small, .mail-boxes small { color: var(--muted); }
.mail-count { display: inline-block; min-width: 22px; text-align: center; background: var(--blue-deep); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 0.8rem; margin-left: 6px; }
.mail-boxes progress { width: 100%; height: 6px; margin-top: 6px; accent-color: var(--blue); }
.mail-error { color: #ff9a8a; }
.mail-main { min-width: 0; }
.mail-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mail-list li + li { border-top: 1px solid var(--line); }
.mail-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 10px 14px; color: var(--muted); background: var(--bg-deep); }
.mail-list a:hover { background: var(--surface); text-decoration: none; }
.mail-list .unread a { background: var(--surface); color: var(--text); }
.mail-list .unread .mail-who, .mail-list .unread .mail-subject { font-weight: 700; }
.mail-who, .mail-subject, .mail-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-who { color: var(--text); }
.mail-when { font-size: 0.85rem; }
.mail-subject { grid-column: 1 / -1; color: var(--text); }
.mail-subject .tag { margin: 0 6px 0 0; }
.mail-preview { grid-column: 1 / -1; font-size: 0.88rem; }
.mail-clip { color: var(--muted); font-weight: 400; }
.mail-read { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.mail-read h2 { margin-top: 0; overflow-wrap: anywhere; }
.mail-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 14px; font-size: 0.93rem; }
.mail-meta dt { color: var(--muted); }
.mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-files { margin: 0 0 4px; padding-left: 20px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; line-height: 1.55; margin-top: 12px; }
@media (max-width: 820px) {
  .mail { grid-template-columns: 1fr; }
}
.mail-move { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.mail-move .panel-note { margin: 0 4px 0 0; }
.mail-why { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); }
.mail-bucket-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.mail-bucket-note .panel-note { margin: 0; flex: 1 1 300px; }
.mail-sent { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; }
.mail-sent summary { cursor: pointer; color: var(--muted); }
.mail-reply { margin-top: 16px; }
.mail-reply h3 { margin-top: 0; }
.mail-draft { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: end; margin-bottom: 16px; }
.mail-draft label { grid-column: 1 / -1; color: var(--muted); font-size: 0.9rem; }
.mail-draft input, .mail-reply-form input, .mail-reply-form textarea { width: 100%; background: var(--bg-deep); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; }
.mail-reply-form { max-width: none; }
.mail-reply-form textarea { resize: vertical; line-height: 1.55; }
.mail-reply-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-sent-row summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 10px 14px; cursor: pointer; background: var(--bg-deep); color: var(--muted); list-style: none; }
.mail-sent-row summary::-webkit-details-marker { display: none; }
.mail-sent-row summary:hover { background: var(--surface); }
.mail-sent-row .mail-body { margin: 0 14px 10px; }
.mail-sent-row p { margin: 0 14px 12px; }
.mail-list .mail-sent-row p a { display: inline; padding: 0; background: none; color: var(--blue); }
.mail-list .mail-sent-row p a:hover { text-decoration: underline; }
.contact-form { max-width: none; }
.contact-form input, .contact-form textarea { width: 100%; background: var(--bg-deep); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; }
.contact-form textarea { resize: vertical; line-height: 1.55; }

.album-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.album-list a { display: flex; gap: 14px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-deep); color: var(--text); }
.album-list a:hover { background: var(--surface-2); text-decoration: none; }
.album-list img { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; flex: none; }
.album-list-text { display: grid; gap: 2px; min-width: 0; }
.album-list-text small { color: var(--muted); }
.album-form, .album-delete { max-width: none; }
.album-form input[type=text], .album-form input[type=number], .album-form input[type=date], .album-form input[type=time], .album-form textarea,
.genre-row input { background: var(--bg-deep); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font: inherit; }
.album-form input[type=text], .album-form textarea { width: 100%; }
.album-form textarea { resize: vertical; line-height: 1.55; }
.album-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 140px; gap: 12px; }
.album-row input { width: 100%; }
.album-schedule .album-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.album-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 6px 0; }
.album-genres { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.album-genres legend, .album-schedule legend { color: var(--muted); padding: 0 6px; }
.album-check { display: flex; gap: 8px; align-items: center; }
.album-cover-edit { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.album-cover-edit img { width: 160px; height: 160px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.album-cover-edit img[hidden] { display: none; }
.genre-list { display: grid; gap: 6px; }
.genre-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.genre-row input[name=sort] { width: 80px; }
.genre-row small { color: var(--muted); }
.genre-delete { margin: -2px 0 6px; }
.genre-new { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .album-row, .album-schedule .album-row { grid-template-columns: 1fr; } .album-cover-edit { flex-direction: column; } }
.album-form input[type=checkbox] { width: auto; min-height: 0; height: auto; padding: 0; margin: 0; flex: none; accent-color: var(--blue); }
.album-form .album-genres label, .album-form .album-check, .album-delete .album-check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; justify-content: flex-start; }
.album-form .album-check { justify-self: start; }

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

.truss-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}

.truss-stats div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.truss-stats dt { color: var(--muted); font-size: 0.85rem; }
.truss-stats dd { margin: 4px 0 0; font: 600 1.15rem/1.3 var(--mono); }

.chain-wrap {
  background: radial-gradient(ellipse at 50% 60%, rgba(31, 157, 255, 0.08), transparent 70%), var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 0 6px;
  margin-bottom: 24px;
}

.chain-nav { display: flex; justify-content: space-between; padding: 0 16px; min-height: 1.6em; font-size: 0.9rem; }
.chain-nav a { color: var(--blue); }
.chain-newest { margin-left: auto; }

.chain {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 14px 24px 18px;
  scrollbar-width: thin;
}

.chain-block, .chain-next {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 120px;
  padding: 6px 4px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.chain-block img {
  width: 96px;
  height: 96px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 71%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 71%);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.chain-block:hover img, .chain-block:focus-visible img { transform: translateY(-3px); }
.chain-block.active { border-color: var(--line); background: rgba(31, 157, 255, 0.06); }
.chain-block.active img { filter: drop-shadow(0 0 10px rgba(31, 157, 255, 0.55)); }

.chain-number { font: 600 0.95rem/1.2 var(--mono); }
.chain-time { color: var(--muted); font-size: 0.75rem; text-align: center; }

.chain-link {
  position: relative;
  flex: 0 0 56px;
  height: 2px;
  margin-bottom: 34px;
  background: linear-gradient(90deg, rgba(31, 157, 255, 0.35), rgba(31, 157, 255, 0.8));
  box-shadow: 0 0 8px rgba(31, 157, 255, 0.55);
  overflow: hidden;
}

.chain-link::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -12px;
  width: 12px;
  height: 6px;
  border-radius: 3px;
  background: #cfeaff;
  box-shadow: 0 0 8px #8fd0ff;
  animation: chain-pulse 2.4s linear infinite;
}

.chain-link-next {
  background: repeating-linear-gradient(90deg, rgba(31, 157, 255, 0.45) 0 6px, transparent 6px 12px);
  box-shadow: none;
}

.chain-link-next::after { display: none; }

.chain-next { cursor: default; }

.chain-ghost {
  width: 64px;
  height: 64px;
  margin: 16px 0;
  border: 1px dashed rgba(169, 181, 193, 0.45);
  border-radius: 8px;
  transform: rotate(45deg) scale(0.8);
  animation: chain-ghost 3s ease-in-out infinite;
}

@keyframes chain-pulse { to { left: 100%; } }
@keyframes chain-ghost { 50% { opacity: 0.35; } }

.block-card {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.block-media img, .block-media video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 55%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 55%, transparent 72%);
}

.block-text h2 { margin: 0 0 10px; }
.block-note p { margin: 0 0 10px; }
.block-empty { color: var(--muted); }
.block-events { padding-left: 18px; }
.event-kind { color: var(--blue); font-weight: 600; }

.block-facts { margin: 14px 0 0; display: grid; gap: 8px; }
.block-facts div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.block-facts dt { color: var(--muted); }
.block-facts dd { margin: 0; }
.block-facts code { font: 0.82rem/1.4 var(--mono); word-break: break-all; color: #cfe3f5; }
.block-facts .muted { color: var(--muted); font-size: 0.85rem; }

.truss-check { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 24px 0; }
.truss-check-result { margin: 0; }
.truss-check-result.good { color: #7fd99a; }
.truss-check-result.bad { color: #ff9b8a; }

.truss-how, .truss-legal { margin-top: 28px; }
.truss-how ol { padding-left: 22px; }
.truss-how li { margin-bottom: 8px; }

.truss-legal {
  border-left: 3px solid var(--blue);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
}

.truss-legal h2 { margin: 0 0 6px; font-size: 1.1rem; }
.truss-legal p { margin: 0; }

@media (max-width: 720px) {
  .block-card { grid-template-columns: 1fr; }
  .block-media { max-width: 280px; margin: 0 auto; }
  .block-facts div { grid-template-columns: 1fr; gap: 0; }
}

.stats.stats-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stats-wide .stat strong { font-size: 1.2rem; font-family: var(--mono); }
.truss-stats dd { font-size: 1.05rem; }

.truss-stat-mine { border-color: rgba(31, 157, 255, 0.55) !important; box-shadow: 0 0 14px rgba(31, 157, 255, 0.18); }

.truss-me { margin: -8px 0 20px; }
.truss-me p { margin: 0 0 6px; }
.truss-admin-note { color: #ffcf7a; font-size: 0.9rem; }
.truss-mine { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.truss-mine a { font-family: var(--mono); color: var(--blue); }
.truss-mine-none { color: var(--muted); }

.block-txs-title { margin: 14px 0 6px; font-size: 1rem; }
.block-txs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.block-txs li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 6px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tx-kind { font-weight: 600; }
.tx-amount { font-family: var(--mono); }
.tx-amount.plus { color: #7fd99a; }
.tx-amount.minus { color: #ff9b8a; }
.tx-ref, .tx-who { color: var(--muted); font: 0.8rem/1.3 var(--mono); }

.forge {
  background: radial-gradient(ellipse at 60% 50%, rgba(31, 157, 255, 0.07), transparent 70%), var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px 18px;
  margin: 8px 0 18px;
  text-align: center;
}

.forge-tag { margin: 0 0 6px; color: var(--muted); font-size: 0.85rem; }

.forge-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.forge-prev { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
.forge-prev img { width: 96px; height: 96px; -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 71%); mask-image: radial-gradient(circle, #000 52%, transparent 71%); }

.forge-thread { position: relative; flex: 0 1 120px; height: 2px; margin: 0 6px 22px; }

.forge-thread span {
  position: absolute;
  right: 0;
  top: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(31, 157, 255, 0.35), rgba(31, 157, 255, 0.9));
  box-shadow: 0 0 8px rgba(31, 157, 255, 0.6);
  transition: width 1.1s ease-out;
}

.forge.linked .forge-thread span { width: 100%; }

.forge-new { position: relative; flex: 0 0 300px; height: 260px; }

.forge-queue {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.forge-queue li {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font: 0.8rem/1.3 var(--mono);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.forge.q1 .forge-queue li:nth-child(1),
.forge.q2 .forge-queue li:nth-child(2),
.forge.q3 .forge-queue li:nth-child(3) { opacity: 1; transform: none; }

.forge.cube .forge-queue { opacity: 0; transform: scale(0.3); }

.forge-cube, .forge-sign {
  position: absolute;
  left: 40px;
  top: 10px;
  width: 220px;
  height: 220px;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 72%);
  mask-image: radial-gradient(circle, #000 55%, transparent 72%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.forge.cube .forge-cube { opacity: 1; transform: none; }
.forge.signing .forge-sign { opacity: 1; transform: none; transition-duration: 0.3s; }
.forge.signing .forge-cube { opacity: 0; transition-duration: 0.3s; }

.forge-badge {
  position: absolute;
  right: 0;
  top: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(127, 217, 154, 0.15);
  border: 1px solid rgba(127, 217, 154, 0.6);
  color: #7fd99a;
  font-size: 0.8rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.forge.signed .forge-badge { opacity: 1; transform: none; }

.forge-number { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity 0.6s ease; }
.forge.cube .forge-number { opacity: 1; }

.forge-hash {
  display: block;
  min-height: 1.4em;
  margin: 8px 0 0;
  font: 0.78rem/1.4 var(--mono);
  color: #cfe3f5;
  word-break: break-all;
}

.forge-replay { margin-top: 10px; }
.forge-replay[hidden] { display: none; }

.forge-steps li { transition: color 0.3s ease; }
.forge-steps li.active { color: var(--blue); }

@media (max-width: 560px) {
  .forge-stage { min-height: 200px; }
  .forge-prev img { width: 64px; height: 64px; }
  .forge-thread { flex-basis: 40px; }
  .forge-new { flex-basis: 220px; height: 200px; }
  .forge-cube, .forge-sign { width: 170px; height: 170px; left: 25px; top: 5px; }
  .forge-queue li { font-size: 0.66rem; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .chain-link::after, .chain-ghost { animation: none; }
}

.player-sat { display: block; margin-top: 2px; color: var(--muted); font-size: 0.78rem; }
.player-sat.got { color: #7fd99a; font-weight: 600; }

.sat-balance { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin: 0 0 10px; }
.sat-balance strong { font: 600 1.5rem/1.2 var(--mono); }

.switches { display: grid; gap: 10px; }
.switch-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 20px;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.switch-text { display: grid; gap: 2px; flex: 1 1 320px; }
.switch-text .panel-note { margin: 0; }
.switch-source { color: var(--muted); font-size: 0.78rem; }
.switch-form { display: flex; align-items: center; gap: 12px; margin: 0; }
.switch-state { font-weight: 600; color: var(--muted); min-width: 7em; text-align: right; }
.switch-state.on { color: #7fd99a; }

.mk-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; background: var(--bg-deep); }
.mk-card.mk-focus { border-color: var(--blue); }
.mk-meta { margin: 0 0 8px; color: var(--muted); }
.mk-meta .tag { margin-left: 0; }
.mk-img { display: block; max-width: 100%; max-height: 340px; border-radius: 8px; margin: 6px 0 10px; border: 1px solid var(--line); }
.mk-form { margin: 0; }
.mk-form textarea { line-height: 1.55; }
.mk-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mk-row input:not([type=checkbox]) { flex: 1 1 240px; min-width: 0; }
.mk-label { color: var(--muted); font-weight: 600; }
.mk-over { color: #e3a3a3; }
.mk-body { white-space: normal; line-height: 1.55; }
.mk-recent { margin: 6px 0; }
.mk-recent .tag { margin-left: 0; }
.mk-status { margin-top: 22px; }
.mk-row label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; white-space: nowrap; }
.mk-row input[type=file] { flex: 1 1 240px; color: var(--muted); }
.mk-line { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.mk-line > input[type=checkbox] { margin-top: 14px; flex: none; }
.mk-line > p { margin: 4px 0; }
.mk-item { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-deep); }
.mk-item.mk-focus { border-color: var(--blue); }
.mk-item[open] > .mk-sum { border-bottom: 1px solid var(--line); }
.mk-item > .mk-card { border: 0; margin: 0; background: transparent; }
.mk-sum { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 14px; cursor: pointer; list-style: none; }
.mk-sum::-webkit-details-marker { display: none; }
.mk-sum .tag { margin-left: 0; }
.mk-sum-topic { color: var(--muted); font-weight: 600; }
.mk-sum-text { flex: 1 1 260px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-sum-when, .mk-sum-slot { color: var(--muted); font-size: .9em; }
.mk-sum-slot { color: var(--text); }
.mk-bulk { margin-top: 12px; }
.mk-plan { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--blue); border-radius: 10px; background: var(--surface); }

.footer-social { margin: 0; }
.footer-x { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.footer-x:hover { color: #fff; }
.footer-x svg { color: #fff; }
.xfeed { max-width: 1180px; margin: 40px auto; padding: 0 20px; }
.xfeed-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.xfeed-head h2 { margin: 0; }
.xfeed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.xpost { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-deep); }
.xpost-author { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.xpost-author img { border-radius: 50%; }
.xpost-author span { display: flex; flex-direction: column; line-height: 1.25; }
.xpost-author span span { color: var(--muted); font-size: .9em; }
.xpost-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.xpost-text { margin: 0; line-height: 1.55; flex: 1; }
.xpost-link { color: var(--muted); font-size: .9em; }
.mk-ref { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.mk-plan-text { flex: 1 1 260px; }
.mk-product { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
