:root {
  --bg: #10262c;
  --bg-2: #1b3d45;
  --card: #f0f3f3;
  --ink: #16242a;
  --muted: #5a6a71;
  --line: #d3dbde;
  --accent: #b3362d;
  --accent-ink: #ffffff;
  --link: #0f6a78;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: radial-gradient(ellipse at 50% 38%, var(--bg-2), var(--bg) 72%) fixed var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* robot page */
body.face {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
body.face main { height: 100%; display: grid; place-items: center; padding: 12px; }
#robot { display: block; width: min(94vw, 76vh); width: min(94vw, 76dvh); height: auto; overflow: visible; }

.lid { transform: translateY(-114px); transition: transform .07s linear; }
.blink .lid { transform: none; }

.led { animation: led 2.4s ease-in-out infinite; }
.led:nth-child(2) { animation-delay: .2s; }
.led:nth-child(3) { animation-delay: .4s; }
.led:nth-child(4) { animation-delay: .6s; }
.led:nth-child(5) { animation-delay: .8s; }
.led:nth-child(6) { animation-delay: 1s; }
.led:nth-child(7) { animation-delay: 1.2s; }
@keyframes led { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .led { animation: none; opacity: .8; }
  .lid { transition: none; }
}

/* private section */
body.my { padding: 32px 16px; }
.wrap { max-width: 680px; margin: 0 auto; }
.card { background: var(--card); border-radius: 14px; padding: 24px; }
.card + .card { margin-top: 18px; }
.card.login { max-width: 360px; margin: 12vh auto 0; }
h1 { margin: 0 0 16px; font-size: 22px; line-height: 1.25; }
h2 { margin: 24px 0 8px; font-size: 16px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--accent); font-size: 14px; }

label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
input[type=password] {
  width: 100%; padding: 11px 12px; margin-bottom: 14px;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
}
input[type=password]:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 11px 16px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
}
.login button { width: 100%; }

ul.files { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ul.files li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
ul.files a { color: var(--link); font-weight: 600; overflow-wrap: anywhere; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top h1 { margin: 0; }
.top button { background: transparent; color: var(--muted); padding: 6px 8px; font-weight: 400; }

.clients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
}
.client {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.client h2 {
  margin: 0 0 10px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.qrlink { display: block; }
.qr {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto 12px;
  background: #fff;
  border-radius: 6px;
  image-rendering: pixelated;
}
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--link);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.actions a.ghost {
  background: transparent;
  color: var(--link);
  border: 1px solid var(--line);
}

/* Hiddify shared link */
.linkbox {
  display: block;
  width: 100%;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace;
  resize: vertical;
  overflow-wrap: anywhere;
}
.copybtn { margin-bottom: 14px; }

/* Hiddify QR + install */
.hidgrid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
  margin-bottom: 6px;
}
.hiditem h2 { margin: 0 0 8px; font-size: 15px; }
.hiditem .qr { max-width: 100%; }
.altmask { margin-bottom: 20px; }
.altmask > h2 {
  margin: 0 0 10px;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.altmask .qr { max-width: 180px; }
