@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --e-pink: #d6336c;
  --e-ink: #1f2124;
  --e-panel: #fff;
  --e-line: #e6e9ec;
  --e-muted: #6d7882;
  --e-stage: #f1f3f5;
  --e-sec: #58d0f5;
  --e-col: #6b7c8a;
}

* { box-sizing: border-box; }
.e-body { margin: 0; height: 100vh; overflow: hidden; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: var(--e-ink); background: #f1f3f5; }
button, a { font: inherit; cursor: pointer; }
.e-app { height: 100vh; }
.e-top {
  position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 80;
  display: flex; align-items: center; gap: 8px;
  background: #1f2124; color: #fff; padding: 0 10px;
}
.e-brand {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: #fff; color: #1f2124; font-weight: 800;
}
.e-icon, .e-devices button, .e-top-right a {
  background: transparent; color: #fff; border: 0; text-decoration: none; font-size: 13px; font-weight: 600;
}
.e-icon { width: 32px; height: 32px; border-radius: 8px; background: #34383c; font-size: 18px; }
.e-doc { font-weight: 600; margin-right: auto; }
.e-devices { display: flex; background: #34383c; border-radius: 8px; overflow: hidden; }
.e-devices button { padding: 6px 10px; color: #c4c8cc; }
.e-devices button.is-on { background: #4a4f55; color: #fff; }
.e-top-right { display: flex; align-items: center; gap: 12px; }
#update-btn { background: var(--e-pink); color: #fff; border: 0; border-radius: 4px; min-height: 32px; padding: 0 14px; font-weight: 700; }
.e-main { height: 100%; }
.e-panel {
  position: fixed; top: 48px; left: 0; bottom: 0; width: 280px; z-index: 70;
  background: #fff; border-right: 1px solid var(--e-line); overflow: auto;
}
.e-panel-head {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  height: 46px; border-bottom: 1px solid var(--e-line); font-weight: 700;
}
#settings-back { border: 0; background: transparent; font-size: 18px; position: absolute; left: 10px; }
.e-panel-head { position: relative; }
.e-search { display: block; padding: 12px; }
.e-search input, .e-field input, .e-field textarea, .e-field select {
  width: 100%; border: 1px solid #d5d8dc; border-radius: 3px; min-height: 36px; padding: 6px 10px; font: inherit;
}
.e-group { padding: 0 12px 12px; }
.e-group h3 { margin: 8px 0; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--e-muted); }
.e-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.e-widget-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 78px; border: 1px solid #e0e4e8; background: #fff; border-radius: 3px; color: #495157; font-size: 12px;
  cursor: grab; user-select: none;
}
.e-widget-card span { font-size: 20px; line-height: 1; }
.e-widget-card:hover { border-color: var(--e-pink); color: var(--e-pink); }
.e-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--e-line); }
.e-tabs button { border: 0; background: #fff; min-height: 42px; color: var(--e-muted); border-bottom: 2px solid transparent; }
.e-tabs button.is-on { color: var(--e-ink); border-bottom-color: var(--e-pink); }
#settings-body { padding: 14px; }
.e-field { display: grid; gap: 6px; margin: 0 0 14px; font-size: 12px; font-weight: 600; color: #495157; }
.e-field textarea { min-height: 72px; }
.e-inline { display: flex; gap: 6px; }
.e-inline button, .e-link, .ghost {
  border: 1px solid #d5d8dc; background: #fff; border-radius: 3px; min-height: 32px; padding: 0 8px;
}
.e-inline button.is-on { border-color: var(--e-pink); color: var(--e-pink); }
.e-box { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 4px; }
.e-box input { min-width: 0; text-align: center; }
.e-box span { font-size: 10px; font-weight: 500; color: var(--e-muted); }
.e-save { width: 100%; background: var(--e-pink); color: #fff; border: 0; min-height: 38px; border-radius: 3px; font-weight: 700; }
.repeater { display: grid; gap: 8px; margin-bottom: 12px; }
.repeater-item { border: 1px solid var(--e-line); padding: 8px; border-radius: 3px; }
.item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.library { display: flex; flex-wrap: wrap; gap: 6px; }
.library button { width: 42px; height: 42px; border: 1px solid var(--e-line); background: #fff center / cover no-repeat; }
.e-stage { position: fixed; top: 48px; left: 280px; right: 0; bottom: 0; overflow: auto; background: #f1f3f5; }
.e-frame { margin: 0 auto; min-height: 100%; transition: width 0.2s ease; }
.e-frame[data-device="tablet"] { width: 768px; background: #fff; }
.e-frame[data-device="mobile"] { width: 390px; background: #fff; }
.e-gap { height: 28px; display: grid; place-items: center; }
.e-plus {
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--e-pink); color: #fff;
  font-size: 18px; line-height: 1; box-shadow: 0 4px 12px rgba(214, 51, 108, 0.35);
}
.e-sec, .e-col, .e-widget { position: relative; }
.e-sec { background: #fff; outline: 1px dashed rgba(88, 208, 245, 0.9); margin: 8px; }
.e-tab { display: flex; position: absolute; top: 0; left: 0; z-index: 6; align-items: center; gap: 2px; color: #fff; font-size: 11px; font-weight: 700; }
.e-tab button, .e-drag { border: 0; background: transparent; color: inherit; padding: 3px 6px; }
.e-tab-sec { top: -24px; background: var(--e-sec); color: #1f2124; z-index: 8; }
.e-tab-col { top: 0; left: auto; right: 0; background: var(--e-col); z-index: 7; }
.e-tab-widget { top: 26px; background: var(--e-pink); }
.e-drag { cursor: grab; }
.e-row { display: flex; align-items: stretch; gap: var(--gap, 16px); min-height: 48px; }
.e-row.is-column { flex-direction: column; }
.e-row.is-column > .e-col { width: 100% !important; }
.e-col { min-width: 0; }
.e-drop { min-height: 70px; }
body.is-dragging .e-drop { outline: 2px dashed #d6336c; outline-offset: -6px; background: rgba(214, 51, 108, 0.04); }
body.is-dragging .e-placeholder { display: flex; }
.e-drop.is-over, .e-gap.is-over { outline: 2px solid #58d0f5; background: rgba(88, 208, 245, 0.16); }
.e-ghost {
  position: fixed; z-index: 120; pointer-events: none; background: #d6336c; color: #fff;
  padding: 6px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.e-placeholder {
  display: none; min-height: 70px; margin: 8px; border: 1px dashed #d5d8dc; color: var(--e-muted);
  align-items: center; justify-content: center; font-size: 13px;
}
.e-drop:not(:has(.e-widget)) .e-placeholder { display: flex; }
.e-gutter { position: absolute; top: 0; right: -7px; width: 14px; height: 100%; cursor: col-resize; z-index: 5; }
.e-gutter::after { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: transparent; }
.e-col:hover > .e-gutter::after { background: var(--e-col); }
.e-sec.is-hidden { opacity: 0.45; }
.e-live .above { min-height: 0; padding-top: 28px; padding-bottom: 12px; }
.e-modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 30; }
.e-modal[hidden] { display: none; }
.e-modal-card { width: min(520px, calc(100% - 32px)); background: #fff; border-radius: 6px; padding: 18px; }
.e-modal-card h3 { margin: 0 0 12px; text-align: center; }
.e-dir { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.e-dir button { border: 1px solid #d5d8dc; background: #fff; min-height: 34px; padding: 0 12px; border-radius: 3px; }
.e-dir button.is-on { background: var(--e-ink); color: #fff; border-color: var(--e-ink); }
.e-structs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.e-structs button { height: 54px; border: 1px solid #d5d8dc; background: #fff; padding: 8px; }
.e-structs button:hover { border-color: var(--e-pink); }
.struct { display: flex; height: 100%; gap: 3px; }
.struct i { display: block; background: #d5d8dc; height: 100%; }
.e-modal-close { margin-top: 12px; border: 0; background: transparent; color: var(--e-muted); }
.e-menu { position: fixed; z-index: 40; background: #fff; border: 1px solid var(--e-line); min-width: 160px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.e-menu button { display: block; width: 100%; text-align: left; border: 0; background: #fff; min-height: 34px; padding: 0 12px; }
.e-menu button:hover { background: #f6f7f8; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #1f2124; color: #fff; border-radius: 99px; padding: 8px 14px; z-index: 50; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }

.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse 50% 40% at 50% 0%, #faf2eb, transparent 70%), #fff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.login-card { width: min(420px, 100%); display: grid; gap: 10px; background: #fff; border: 1px solid #eceae7; border-radius: 16px; padding: 22px; }
.login-card img { width: 56px; height: 56px; }
.login-card h1 { margin: 0; }
.login-card p { margin: 0; color: #6d6864; }
.login-card input { width: 100%; border: 1px solid #e3e0dc; border-radius: 8px; min-height: 40px; padding: 0 10px; font: inherit; }
.login-card button { min-height: 42px; background: #f47b24; color: #fff; border: 0; border-radius: 8px; font-weight: 700; }
.login-note { font-size: 13px; }
.form-error { color: #9a3b32; }
