:root {
  --bg: #000d19;
  --glow: #00264d;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-solid: #0f1a26;
  --raised: #1a2633;
  --popover: #222f3d;
  --control: rgba(255, 255, 255, 0.1);
  --control-hover: rgba(255, 255, 255, 0.16);
  --hover: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.42);
  --accent: #6fa0ff;
  --accent-soft: rgba(111, 160, 255, 0.16);
  --accent-text: #000d19;
  --green: #3ccf8e;
  --red: #ff5363;
  --amber: #f5b942;
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }

body {
  color: var(--text);
  background: radial-gradient(1200px circle at 0 200px, var(--glow), transparent 50%) fixed, var(--bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.icon { width: 18px; height: 18px; flex-shrink: 0; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

.admin { display: flex; flex-direction: column; height: 100vh; }

.topnav { flex-shrink: 0; padding: 12px 16px 0; position: relative; z-index: 20; }

.topnav-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 0 8px;
  border-radius: 9999px;
  background: rgba(60, 70, 80, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 4px 14px 4px 4px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 700;
}
.topnav-brand:hover { background: var(--hover); }

.rail-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
}
.rail-mark .icon { width: 21px; height: 21px; }

.topnav-tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav-tabs::-webkit-scrollbar { display: none; }

.topnav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 9999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.topnav-tab .icon { width: 17px; height: 17px; }
.topnav-tab:hover { color: var(--text); background: var(--hover); }
.topnav-tab.active { color: var(--text); background: var(--control-hover); }

.topnav-sep { width: 1px; height: 26px; background: var(--line-strong); flex-shrink: 0; margin: 0 4px; }
.topnav-end { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.topnav-end .icon-btn { width: 40px; height: 40px; border-radius: 50%; }
.topnav-end .icon-btn .icon { width: 18px; height: 18px; }

.savebar { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.save-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.save-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.save-status.is-dirty .dot { background: var(--amber); }
.savebar .btn { height: 40px; }

.view { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.view.is-fixed { overflow: hidden; }

.label-with-icon { display: inline-flex; align-items: center; gap: 6px; }
.label-with-icon .icon { width: 14px; height: 14px; }

@media (max-width: 1360px) {
  .topnav-brand span:last-child { display: none; }
  .topnav-brand { padding-right: 4px; }
}
@media (max-width: 1200px) {
  .topnav-tab span { display: none; }
  .topnav-tab { padding: 0 12px; }
}
@media (max-width: 900px) {
  .save-text { display: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--control);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--control-hover); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: #8ab2ff; }
.btn-danger { background: rgba(255, 83, 99, 0.14); color: var(--red); }
.btn-danger:hover { background: rgba(255, 83, 99, 0.24); }
.btn-ghost { background: none; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--control); color: var(--text); }
.icon-btn.is-danger:hover { background: rgba(255, 83, 99, 0.16); color: var(--red); }
.icon-btn.is-on { color: var(--accent); }
.icon-btn .icon { width: 16px; height: 16px; }

.card {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 0; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .hint { margin: 0; }
.card-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }

.split { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 16px; height: 100%; }
.split > .scroll { overflow: auto; padding-right: 4px; padding-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.hint { margin: 0; font-size: 12px; color: var(--faint); }
.hint a { color: var(--accent); text-decoration: underline; }
.row { display: flex; gap: 12px; align-items: flex-start; }
.row.center { align-items: center; }
.field-action { padding-top: 23px; }
.row > * { flex: 1; min-width: 0; }
.row > .shrink { flex: 0 0 auto; }

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.07); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: var(--popover); }

.prefixed { display: flex; align-items: center; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }
.prefixed:focus-within { border-color: var(--accent); }
.prefixed span { padding-left: 12px; color: var(--faint); white-space: nowrap; }
.prefixed .input { border: 0; background: none; padding-left: 2px; }

.segmented { display: flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.segmented button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--control-hover); color: var(--text); }
.segmented .icon { width: 15px; height: 15px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toggle-label { font-size: 13px; font-weight: 500; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 9999px; background: var(--control-hover); transition: background-color 0.15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.color { display: flex; align-items: center; gap: 8px; }
.color input[type="color"] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: none; cursor: pointer; flex-shrink: 0; }
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.color .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; text-transform: lowercase; }
.color .input::placeholder { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-transform: none; }
.color.is-auto input[type="color"], .color-swatch.is-auto input[type="color"] { opacity: 0.6; border-style: dashed; }
.color.is-optional .icon-btn { flex-shrink: 0; }

.color-swatch { position: relative; display: inline-flex; }
.color-swatch input[type="color"] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: none; cursor: pointer; }
.color-swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.color-swatch input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.swatch-reset {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--control-hover);
  color: var(--text);
  cursor: pointer;
}
.swatch-reset .icon { width: 11px; height: 11px; }
.swatch-reset:hover { background: var(--red); }

.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
@media (max-width: 1200px) { .color-grid { grid-template-columns: minmax(0, 1fr); } }

.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { min-width: 44px; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.image-field { display: flex; align-items: center; gap: 12px; }
.thumb {
  width: 64px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--line-strong);
  color: var(--faint);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-set { border-style: solid; border-color: var(--line); }

.icon-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  width: 100%;
}
.icon-field:hover { border-color: var(--line-strong); }
.icon-field .grow { flex: 1; color: var(--muted); }

.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.icon-grid button { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; color: var(--muted); }
.icon-grid button:hover { background: var(--control); color: var(--text); }
.icon-grid button.active { background: var(--accent-soft); color: var(--accent); }
.icon-grid .icon { width: 19px; height: 19px; }

.list-editor { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: grid; grid-template-columns: 120px 1fr 1fr auto; gap: 8px; align-items: center; }
.list-row.has-swatch { grid-template-columns: 120px 1fr 1fr auto auto; }

.popover {
  position: fixed;
  z-index: 70;
  min-width: 220px;
  max-height: min(520px, calc(100vh - 32px));
  overflow: auto;
  padding: 6px;
  border-radius: 16px;
  background: var(--popover);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  animation: pop 0.12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.popover-title { padding: 8px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}
.menu-item:hover { background: var(--hover); }
.menu-item .icon { color: var(--muted); }
.menu-item small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; }
.menu-item .mi-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--control); flex-shrink: 0; }

.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 4, 10, 0.6); backdrop-filter: blur(3px); animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 81;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  transform: translate(-50%, -50%);
  border-radius: 22px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  animation: rise 0.18s ease-out;
}
.modal.is-wide { width: min(860px, calc(100vw - 32px)); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -47%); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px 24px; }
.modal-head h2 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { flex: 1; overflow: auto; padding: 4px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px 18px 24px; border-top: 1px solid var(--line); }
.modal-foot .spacer { flex: 1; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--popover);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  animation: pop 0.15s ease-out;
}
.toast .icon { color: var(--green); }
.toast.is-error .icon { color: var(--red); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { position: relative; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: rgba(255, 255, 255, 0.04); }
.media-meta { padding: 8px 10px; font-size: 12px; }
.media-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-size { color: var(--faint); }
.media-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.media-item:hover .media-actions, .media-item:focus-within .media-actions { opacity: 1; }
.media-actions .icon-btn { background: rgba(0, 0, 0, 0.6); color: #fff; }
button.media-item { text-align: left; transition: border-color 0.15s, transform 0.15s; }
button.media-item:hover { border-color: var(--accent); transform: translateY(-2px); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1.5px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 28px; height: 28px; }

.empty { padding: 32px; text-align: center; color: var(--faint); }

.item-list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.item:hover { border-color: var(--line-strong); }
.item.is-off { opacity: 0.55; }
.item-cover { width: 72px; height: 48px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); }
.item-cover img { width: 100%; height: 100%; object-fit: cover; }
.item-cover.has-image img { object-fit: contain; }
.item-cover.round { width: 44px; height: 44px; border-radius: 50%; font-weight: 700; color: #fff; }
.item-text { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.item-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 9999px; background: var(--control); color: var(--muted); font-size: 11px; font-weight: 600; }
.pill.is-accent { background: var(--accent-soft); color: var(--accent); }
.pill.is-green { background: rgba(60, 207, 142, 0.15); color: var(--green); }
.grip { color: var(--faint); cursor: grab; display: grid; place-items: center; }
.grip .icon { width: 16px; height: 16px; }

.dragging { opacity: 0.4; }
.drop-line { height: 2px; margin: -1px 0; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); pointer-events: none; }
.drop-line.is-x { width: 2px; height: auto; margin: 0 -1px; align-self: stretch; }

.builder { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.builder-bar { display: flex; align-items: center; gap: 12px; }
.page-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.page-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.page-tab:hover { color: var(--text); background: var(--hover); }
.page-tab.active { color: var(--text); background: var(--control-hover); }
.page-tab .icon { width: 15px; height: 15px; }
.page-tab .home-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.devices { margin-left: auto; }
.devices button { width: 38px; padding: 0; }

.builder-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; gap: 12px; }

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 16px; }
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 700; flex: 1; }
.panel-head .sub { color: var(--faint); font-weight: 500; }
.panel-body { flex: 1; overflow: auto; padding: 0 10px 12px; }
.inspector .panel-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }

.sections { display: flex; flex-direction: column; gap: 6px; }
.sec { border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; }
.sec.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.sec.is-hidden .sec-title { opacity: 0.5; text-decoration: line-through; }
.sec-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 4px; cursor: pointer; border-radius: 14px; }
.sec-head:hover { background: var(--hover); }
.sec-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--control); flex-shrink: 0; }
.sec-icon .icon { width: 15px; height: 15px; }
.sec-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-actions { display: flex; opacity: 0; transition: opacity 0.12s; }
.sec-head:hover .sec-actions, .sec.is-selected > .sec-head .sec-actions { opacity: 1; }
.sec-actions .icon-btn { width: 26px; height: 26px; border-radius: 8px; }
.sec-actions .icon-btn .icon { width: 14px; height: 14px; }
.collapse .icon { transition: transform 0.15s; }
.sec.is-collapsed .collapse .icon { transform: rotate(-90deg); }
.sec.is-collapsed .blocks, .sec.is-collapsed .add-block { display: none; }

.blocks { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 0 22px; min-height: 6px; }
.blk { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 4px; border-radius: 10px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.blk:hover { background: var(--hover); color: var(--text); }
.blk.is-selected { background: var(--accent); color: var(--accent-text); }
.blk.is-selected .grip, .blk.is-selected .icon-btn { color: var(--accent-text); }
.blk .icon { width: 14px; height: 14px; }
.blk-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .icon-btn { width: 22px; height: 22px; opacity: 0; }
.blk:hover .icon-btn { opacity: 1; }
.add-block { display: flex; align-items: center; gap: 6px; margin: 2px 6px 6px 26px; padding: 5px 8px; border-radius: 9px; color: var(--faint); font-size: 12px; font-weight: 600; }
.add-block:hover { color: var(--accent); background: var(--accent-soft); }
.add-block .icon { width: 13px; height: 13px; }

.inspector-title { display: flex; align-items: center; gap: 10px; }
.inspector-title .sec-icon { width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.inspector-title h3 { margin: 0; font-size: 15px; }
.inspector-title p { margin: 0; color: var(--faint); font-size: 12px; }
.divider { height: 1px; background: var(--line); margin: 2px 0; }
.group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-top: 4px; }

.stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); overflow: hidden; }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.stage-url { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.stage-live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }
.stage-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stage-frame { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.stage-frame iframe { position: absolute; top: 0; left: 50%; border: 0; transform-origin: top center; background: #000; border-radius: 0; }
.stage-frame.is-device iframe { top: 12px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 20px 50px rgba(0, 0, 0, 0.5); }
.stage-note { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.stage-note code { color: var(--text); }

.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login {
  width: min(380px, 100%);
  padding: 32px 28px 28px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login .rail-mark { margin: 0 0 4px; }
.login h1 { margin: 0; font-size: 22px; }
.login p { margin: 0; color: var(--muted); }
.login .btn { height: 44px; margin-top: 6px; font-size: 14px; }
.error { margin: 0; color: var(--red); font-size: 13px; }

.product-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.product-row:last-child { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--green); }
.status.off { color: var(--faint); }
.status.bad { color: var(--red); }

.item-stats { display: inline-flex; gap: 12px; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.item-stats span { display: inline-flex; align-items: center; gap: 4px; }
.item-stats .icon { width: 13px; height: 13px; }

.link-check:empty { display: none; }
.link-check { display: flex; flex-direction: column; gap: 6px; margin-top: -4px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); }
.check-row .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.check-row.is-ok .icon { color: var(--green); }
.check-row.is-warn .icon { color: var(--amber); }

.gallery-editor { display: flex; flex-direction: column; gap: 10px; }
.gallery-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gallery-tile { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 14px; background: var(--control); }
.tile-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 9px; background: #000; }
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile-badge { position: absolute; left: 6px; bottom: 6px; display: grid; place-items: center; width: 26px; height: 20px; border-radius: 6px; background: #ff0033; color: #fff; }
.tile-badge .icon { width: 14px; height: 14px; }
.gallery-tile .input { height: 32px; font-size: 12px; }
.tile-actions { display: flex; align-items: center; gap: 2px; }
.tile-actions .spacer { flex: 1; }
.tile-actions .icon-btn { width: 30px; height: 30px; }
.tile-actions .icon-btn.is-hidden { visibility: hidden; }

.video-thumb:empty { display: none; }
.video-thumb { margin-top: -6px; overflow: hidden; border-radius: 12px; aspect-ratio: 16 / 9; background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }

.files-editor { display: flex; flex-direction: column; gap: 10px; }
.file-rows { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--control); }
.file-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.file-icon .icon { width: 18px; height: 18px; }
.file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-text .input { height: 32px; font-size: 13px; }
.file-text .hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.file-text .hint a { color: var(--accent); }
.file-row .icon-btn.is-hidden { visibility: hidden; }
.upload-progress { display: flex; flex-direction: column; gap: 6px; }
.upload-bar { height: 6px; overflow: hidden; border-radius: 6px; background: var(--control); }
.upload-bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--accent); transition: width 0.2s; }

.invite-status:empty { display: none; }
.invite-status { display: flex; flex-direction: column; gap: 6px; margin-top: -6px; }
.invite-ok { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.invite-ok .icon { width: 16px; height: 16px; color: var(--green); flex-shrink: 0; }
.invite-ok strong { color: var(--text); }

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--control);
  font-size: 14px;
}
.notice > .icon { width: 20px; height: 20px; flex-shrink: 0; }
.notice .grow { flex: 1; min-width: 0; }
.notice a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.notice.is-info > .icon { color: var(--accent); }
.notice.is-warn { border-color: rgba(245, 185, 66, 0.35); background: rgba(245, 185, 66, 0.1); }
.notice.is-warn > .icon { color: var(--amber); }
.notice.is-ok { border-color: rgba(60, 207, 142, 0.3); background: rgba(60, 207, 142, 0.08); }
.notice.is-ok > .icon { color: var(--green); }
.steps { margin: 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.steps code, .hint code { color: var(--text); background: var(--control); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 600;
}
.swatch:hover { border-color: var(--line-strong); }
.swatch i { width: 22px; height: 22px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }

@media (max-width: 1280px) {
  .builder-body { grid-template-columns: 260px minmax(0, 1fr) 290px; }
}
@media (max-width: 1100px) {
  .builder-body { grid-template-columns: 250px minmax(0, 1fr); }
  .builder-body .inspector { grid-column: 1 / -1; max-height: 420px; }
  .view.is-fixed { overflow: auto; }
  .builder { height: auto; }
  .builder-body { min-height: 760px; }
  .split { grid-template-columns: 1fr; height: auto; }
  .split .stage { height: 640px; }
}
