:root {
  color-scheme: dark;
  --bg: #03111b;
  --bg-2: #071c2b;
  --panel: rgba(8, 28, 43, 0.84);
  --panel-2: rgba(9, 36, 55, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5fbff;
  --muted: #a9c0ce;
  --accent: #ffd36f;
  --accent-2: #76d1ff;
  --ok: #80dfac;
  --bad: #ff8989;
  font:
    16px system-ui,
    -apple-system,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0, rgba(34, 134, 202, 0.33), transparent 30rem),
    radial-gradient(circle at 100% 15%, rgba(255, 211, 111, 0.16), transparent 18rem),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
}
header,
main {
  width: min(1180px, calc(100% - 20px));
  margin: auto;
}
header {
  padding: max(20px, env(safe-area-inset-top)) 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
small {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.45rem, 5vw, 2.35rem);
  letter-spacing: -0.03em;
}
h2 {
  font-size: 1.18rem;
}
.header-actions,
.buttons,
.title,
.vm,
.vm > div:last-child,
.card-pill,
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.identity {
  color: var(--muted);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.panel,
.warning {
  background: linear-gradient(180deg, var(--panel), rgba(6, 19, 30, 0.86));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}
.login {
  max-width: 460px;
  margin: 7vh auto 0;
}
.login p {
  color: var(--muted);
  margin: 10px 0 18px;
  line-height: 1.45;
}
.login form {
  display: grid;
  gap: 10px;
}
.grid {
  display: grid;
  grid-template-columns: 1.12fr 0.98fr;
  gap: 16px;
  margin-top: 16px;
}
.vm {
  justify-content: space-between;
}
.vm p {
  color: var(--muted);
  margin-top: 4px;
}
button,
input,
select {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  min-height: 46px;
}
select {
  width: 100%;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.login label,
label {
  color: var(--muted);
}
.login label {
  font-size: 0.85rem;
  margin-bottom: -6px;
}
button {
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}
button:hover {
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.45;
  transform: none;
}
.primary,
.active {
  background: linear-gradient(180deg, #ffe08d, #ffbf43);
  color: #1b2430;
  border: 0;
  font-weight: 800;
}
.title {
  justify-content: space-between;
  margin-bottom: 12px;
}
.view {
  position: relative;
  aspect-ratio: 4/3;
  background:
    radial-gradient(circle at 50% 20%, rgba(118, 209, 255, 0.18), transparent 55%),
    #02070b;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.native-view {
  min-height: 180px;
  align-items: center;
}
.view p {
  position: absolute;
  color: var(--muted);
  text-align: center;
  padding: 0 14px;
}
.buttons {
  justify-content: center;
  margin: 14px 0 10px;
  flex-wrap: wrap;
}
.shutter {
  min-width: 132px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(180deg, #ffe08d, #ffbf43);
  color: #1b2430;
  font-weight: 800;
  box-shadow: 0 8px 30px rgba(255, 211, 111, 0.32);
}
nav {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-bottom: 12px;
  padding-bottom: 4px;
}
nav button {
  white-space: nowrap;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 999px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 65vh;
  overflow: auto;
}
.gallery article {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
}
.thumb {
  aspect-ratio: 4/3;
  background: #010608;
}
.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.meta {
  padding: 11px;
  display: grid;
  gap: 6px;
}
.meta span,
.meta em {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: normal;
}
.meta div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.meta button {
  font-size: 0.74rem;
  padding: 6px 9px;
  min-height: 34px;
  border-radius: 10px;
}
.status {
  margin-top: 10px;
  color: var(--muted);
}
.status.ok {
  color: var(--ok);
}
.status.error {
  color: var(--bad);
}
.warning {
  margin: 16px 0 max(20px, env(safe-area-inset-bottom));
  color: #ffe5a3;
  background: linear-gradient(180deg, rgba(90, 64, 14, 0.42), rgba(50, 34, 9, 0.34));
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .vm {
    align-items: flex-start;
    flex-direction: column;
  }
  .gallery {
    max-height: none;
  }
}
@media (max-width: 520px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .identity {
    flex: 1;
    min-width: 0;
  }
  .gallery {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 14px;
  }
  .login {
    margin-top: 3vh;
  }
  .buttons {
    gap: 8px;
  }
  .shutter {
    min-width: 100%;
  }
}
@media (max-width: 600px) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  header, main { width: min(100% - 16px, 1180px); }
  header { position: sticky; top: 0; z-index: 5; padding: calc(10px + env(safe-area-inset-top)) 2px 10px; background: linear-gradient(var(--bg) 75%, transparent); }
  .view { aspect-ratio: 3 / 4; max-height: 64vh; }
  .buttons { display: grid; grid-template-columns: 1fr 72px 1fr; }
  .shutter { width: 68px; height: 68px; }
  .buttons button:not(.shutter) { min-height: 50px; padding: 8px; }
  .meta button { min-height: 44px; flex: 1; }
  .warning { margin-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
