:root {
  color: #1a1a1a;
  font-family: "Segoe UI", sans-serif;
  --ink: #1c1c1c;
  --paper: rgba(255, 255, 255, 0.62);
  --line: rgba(28, 28, 28, 0.08);
  --green: #1f8a5b;
  --red: #d24b4b;
  --orange: #e07a2f;
  --violet: #7a4dff;
  --magenta: #c43d8c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(122, 77, 255, 0.18), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(224, 122, 47, 0.16), transparent 55%),
    radial-gradient(800px 500px at 70% 110%, rgba(31, 138, 91, 0.12), transparent 50%),
    linear-gradient(180deg, #f7f5f2 0%, #ece8e2 100%);
}

.shell { min-height: 100vh; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px 22px 10px;
  background: rgba(247, 245, 242, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.who {
  margin: 2px 0 0;
  color: #6d675f;
  font-size: 12px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

nav a, button.quiet {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

nav a.active, nav a:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--line);
}

button.quiet { color: #6d675f; }

main { padding: 22px 22px 64px; max-width: 1280px; }

h1 { margin: 0 0 6px; font-size: 22px; font-weight: 650; }
h2 { margin: 0 0 8px; font-size: 16px; }

.muted { color: #6d675f; font-size: 13px; }
.flash {
  background: rgba(31, 138, 91, 0.12);
  border: 1px solid rgba(31, 138, 91, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
}

.glass, form.card, .card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 30px rgba(28, 28, 28, 0.05);
  backdrop-filter: blur(16px);
  border-radius: 18px;
}

.card, form.card { padding: 16px; margin: 12px 0; }

label, legend { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 650; }

input[type="text"], input[type="password"], input[type="search"], input[type="date"], input[type="file"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); }

fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; padding: 8px 12px 12px; }

button, .button {
  background: var(--green);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button.danger { background: var(--red); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid var(--line);
}
.chips button.on { background: var(--violet); color: white; border-color: transparent; }

.builder {
  display: grid;
  grid-template-columns: 280px minmax(320px, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.phones { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 18px 8px; }
.phone {
  width: 220px;
  height: 440px;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  background: #111 center/cover no-repeat;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  border: 8px solid #1c1c1c;
}
.phone span.cap {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  color: white;
  font-size: 13px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.phone.fade { animation: fade 1.1s ease; }
.phone.slide { animation: slide 1.1s ease; }
.phone.zoom { animation: zoom 1.1s ease; }
@keyframes fade { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes slide { from { transform: translateY(18px); } to { transform: none; } }
@keyframes zoom { from { transform: scale(1.06); } to { transform: none; } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
th { font-size: 12px; color: #6d675f; font-weight: 650; }
tbody tr:hover { background: rgba(255, 255, 255, 0.45); }

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.dot.warm { background: var(--orange); box-shadow: 0 0 0 4px rgba(224, 122, 47, 0.18); }
.dot.off { background: var(--red); }

.key { font-family: Consolas, monospace; letter-spacing: 0.04em; color: var(--violet); }
.copy { cursor: pointer; border-bottom: 1px dashed #b7b0a6; }

.filters, form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters input, form.inline input { width: auto; min-width: 160px; }

.veil {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.46);
  backdrop-filter: blur(8px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.veil[hidden] { display: none; }
.veil-card {
  width: min(1100px, 100%);
  height: min(720px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  padding: 16px;
  position: relative;
}
.veil-grid { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; align-content: start; }
.veil-grid img, .focus img { width: 100%; height: 92px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.focus { display: flex; flex-direction: column; gap: 8px; }
.focus img { height: min(520px, 70vh); }
.x { position: absolute; top: 10px; right: 10px; background: var(--ink); }

.words {
  position: absolute;
  z-index: 6;
  min-width: 220px;
  max-width: 320px;
  padding: 12px;
  border-radius: 14px;
}
.solo { max-width: 420px; margin: 10vh auto; padding: 0 16px; }

@media (max-width: 980px) {
  .builder, .veil-card { grid-template-columns: 1fr; }
  main { padding: 16px 12px 48px; }
  .phone { width: 180px; height: 360px; }
}
