:root {
  --bg: #0b2236;
  --ink: #f3f8ff;
  --muted: #c4d6e6;
  --cyan: #4fe0ff;
  --line: rgba(79, 224, 255, 0.32);
  --ok: #3dffa6;
  --wa: #25d366;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Orbitron", sans-serif;
  --x: 50%;
  --y: 42%;
  --panel: rgba(10, 36, 56, 0.62);
  --card: rgba(12, 42, 66, 0.86);
  --deep: #08192a;
  --shadow: 0 18px 46px rgba(0, 8, 18, 0.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: rgba(79, 224, 255, 0.18); }
html, body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  color-scheme: dark;
}
html { overflow-x: hidden; }
body { padding: calc(76px + env(safe-area-inset-top)) 0 calc(118px + env(safe-area-inset-bottom)); }
.fx {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(820px circle at var(--x) var(--y), rgba(79, 224, 255, 0.22), transparent 46%),
    radial-gradient(1200px 560px at 50% 118%, rgba(29, 143, 214, 0.38), transparent 62%),
    radial-gradient(780px 420px at 14% 6%, rgba(70, 255, 196, 0.12), transparent 52%),
    radial-gradient(820px 460px at 88% 12%, rgba(110, 90, 255, 0.16), transparent 55%),
    linear-gradient(180deg, #08192a 0%, #0d2740 42%, #164866 78%, #0e2d46 100%);
}
#space, .fx { pointer-events: none !important; }
#space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 1; }
.bar, main, .dock, .sheet { position: relative; }
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 3vw 10px;
  background: linear-gradient(180deg, rgba(8, 25, 42, 0.94), rgba(8, 25, 42, 0.55));
}
main { z-index: 2; }
.brand {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  min-width: 0; flex: 1 1 auto;
  pointer-events: auto;
}
.brand .mark {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--deep);
  flex: 0 0 36px;
}
.brand .word {
  height: 20px; width: auto; max-width: min(48vw, 170px);
  object-fit: contain; object-position: left center;
}
.word-text {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink); font-size: 0.84rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.bar-tools {
  margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  pointer-events: auto; z-index: 51;
}
.sync {
  margin: 0; color: var(--cyan); font-size: 0.68rem; letter-spacing: 0.06em;
  max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.lang button {
  background: transparent; color: var(--muted); border: 0; padding: 0 10px;
  min-width: 36px; min-height: 36px; font-weight: 800; font-family: inherit;
  cursor: pointer; touch-action: manipulation; pointer-events: auto;
}
.lang button[aria-pressed="true"] { background: var(--cyan); color: #041018; }
@media (max-width: 720px) {
  .brand .mark { width: 32px; height: 32px; flex-basis: 32px; }
  .brand .word { height: 16px; max-width: min(42vw, 148px); }
  .word-text { font-size: 0.78rem; }
  .sync { display: none; }
  .lang button { padding: 0 8px; min-width: 32px; min-height: 28px; font-size: 0.68rem; }
}
.intro { padding: 18px 5vw 8px; }
.kicker { font-family: var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); font-size: 0.72rem; margin: 0 0 8px; }
h1, h2 { font-family: var(--display); margin: 0 0 8px; }
h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
.lead { color: var(--muted); margin: 0; }
.origin { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.origin input { flex: 1; min-width: 180px; }
.origin button {
  min-height: 46px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); font-weight: 800; padding: 0 14px;
}
.grid { display: grid; gap: 18px; padding: 8px 4vw 24px; }
.card {
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: var(--card); text-align: left; color: inherit; padding: 0; width: 100%;
  box-shadow: var(--shadow);
}
.card.on { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.card img { width: 100%; height: 168px; object-fit: cover; display: block; }
.card .pad { padding: 12px 14px 14px; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.works { display: grid; gap: 8px; margin-top: 12px; }
.work {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  cursor: pointer;
}
.work.on { border-color: var(--cyan); background: rgba(79, 224, 255, 0.08); }
.work b { font-size: 0.9rem; font-weight: 700; }
.work input {
  width: 20px; min-height: 20px; margin: 0; flex: 0 0 20px;
  accent-color: var(--cyan);
}
.need { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.need label {
  display: block; font-size: 0.8rem; font-weight: 700; color: var(--cyan);
  margin: 0 0 6px; line-height: 1.35;
}
.need textarea { min-height: 78px; resize: vertical; }
.status-msg { color: var(--ok); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 1.2rem;
}
.dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 55;
  display: flex; align-items: center; gap: 12px;
  background: #0d2a42; border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px;
}
.dock strong { color: var(--cyan); }
.dock button, .go {
  min-height: 44px; border: 0; border-radius: 999px; padding: 0 16px; font-weight: 800;
  background: linear-gradient(135deg, #1d8fd6, #4fe0ff); color: #041018;
}
.sheet {
  position: fixed; inset: 0; z-index: 70; background: rgba(8, 25, 42, 0.72);
  display: grid; place-items: end center;
}
.sheet-card {
  width: min(640px, 100%); max-height: 92vh; overflow: auto;
  background: rgba(10, 36, 56, 0.96); border-top: 1px solid var(--line);
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
}
.x {
  float: right; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; min-height: 40px; padding: 0 14px; font-weight: 800;
}
label { display: block; font-weight: 700; margin: 12px 0 6px; }
input, textarea {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(8, 25, 42, 0.7); color: var(--ink); padding: 10px 12px; font: inherit;
  font-size: 16px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; min-height: 40px; padding: 0 12px; font-weight: 700;
}
.chips button.on { background: var(--cyan); color: #041018; border-color: var(--cyan); }
.consent { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 0.92rem; }
.consent input { width: 18px; min-height: 18px; }
.lines { list-style: none; padding: 0; margin: 16px 0 8px; display: grid; gap: 6px; color: var(--muted); }
.sum { font-size: 1.2rem; font-weight: 800; }
.hint { color: var(--muted); font-size: 0.86rem; }
.go { width: 100%; margin-top: 8px; }
@media (min-width: 860px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
body.install-page {
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
body.install-page .intro {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 420px;
  padding: 28px 22px;
}
body.install-page .install-card {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(12, 42, 66, 0.72);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 36px 28px 28px;
}
body.install-page .install-brand {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
body.install-page .install-mark {
  display: inline-grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 28px;
  overflow: visible;
  border: 1px solid var(--line);
  box-shadow: 0 0 0 6px rgba(79, 224, 255, 0.08);
  background: rgba(8, 25, 42, 0.55);
}
body.install-page .install-mark img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  transform: none;
  image-rendering: -webkit-optimize-contrast;
}
body.install-page .install-word {
  height: 28px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}
body.install-page .install-meta {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
}
body.install-page .intro .go.exit {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
[hidden] { display: none !important; }
