:root {
  color-scheme: light;
  --bg: #eef2ee;
  --ink: #111815;
  --muted: #5b6862;
  --line: #cbd5cf;
  --panel: #fbfcf8;
  --panel-strong: #ffffff;
  --accent: #106b58;
  --accent-2: #d25f31;
  --accent-soft: #dcece6;
  --danger: #9d2828;
  --shadow: 0 28px 78px rgba(21, 31, 25, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(130deg, rgba(16, 107, 88, 0.16), rgba(210, 95, 49, 0.07) 38%, rgba(238, 242, 238, 0) 68%),
    radial-gradient(ellipse at 50% -18%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(238, 242, 238, 0.12), rgba(238, 242, 238, 0.72));
}

.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

button,
input {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
  align-items: center;
  padding: 32px 0;
}

.invite-page .shell,
.admin-page .shell {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(251, 252, 248, 0.76)),
    rgba(251, 252, 248, 0.9);
  border: 1px solid rgba(177, 190, 181, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.18);
}

.invite-panel {
  padding: clamp(24px, 5vw, 54px);
}

.admin-panel {
  padding: 24px;
}

.admin-view {
  display: grid;
  gap: 18px;
}

.admin-console {
  display: grid;
  gap: 18px;
}

.admin-lock {
  padding: clamp(24px, 5vw, 46px);
}

.brand-row,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-row {
  justify-content: flex-start;
}

.mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(16, 107, 88, 0.18);
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark svg {
  width: 30px;
  height: 30px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 72px;
  line-height: 0.94;
}

h2 {
  font-size: 24px;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 34px;
}

.form.compact {
  margin-top: 22px;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 107, 88, 0.12);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary,
.secondary {
  height: 50px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 760;
}

.primary {
  margin-top: 10px;
  color: white;
  background: linear-gradient(135deg, var(--accent), #1f7c68);
  box-shadow: 0 12px 26px rgba(16, 107, 88, 0.22);
}

.secondary {
  color: white;
  background: linear-gradient(135deg, #1f2a25, #314239);
}

.primary:hover,
.secondary:hover,
.icon-button:hover {
  filter: brightness(0.96);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(16, 107, 88, 0.2);
  background: rgba(220, 236, 230, 0.78);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.result.error {
  border-color: rgba(157, 40, 40, 0.22);
  background: rgba(157, 40, 40, 0.08);
  color: var(--danger);
}

.result.muted {
  background: rgba(245, 247, 244, 0.8);
}

.url-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.url-row input {
  flex: 1;
}

.copy-button {
  width: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
  cursor: pointer;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.steps div,
.invite-item {
  border: 1px solid rgba(203, 213, 207, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
}

.steps span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.steps p,
.invite-item p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.invite-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.device-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.stat {
  padding: 14px;
  border: 1px solid rgba(203, 213, 207, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
  line-height: 1;
}

.device-item {
  padding: 14px;
  border: 1px solid rgba(203, 213, 207, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.device-item.is-disabled {
  opacity: 0.66;
}

.device-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-input {
  height: 40px;
  font-weight: 760;
}

.status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
}

.status.off {
  color: var(--danger);
  background: rgba(157, 40, 40, 0.08);
}

.device-meta,
.device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tiny {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.invite-item strong {
  display: block;
  font-size: 15px;
}

.invite-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px 0;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1120px);
  }

  .invite-panel,
  .admin-panel {
    padding: 18px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .mark {
    width: 48px;
    height: 48px;
  }

  h1 {
    font-size: 44px;
  }
}
