/* ky-edit — in-page design editor chrome.
   Nothing here paints unless html.ky-editing is set, so the file is inert
   for normal visitors. The panel deliberately does NOT borrow the site's
   tokens: it must stay legible while the user is scaling those tokens. */

#ky-edit-panel { display: none; }

html.ky-editing #ky-edit-panel {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2147483000;
  width: 306px;
  max-height: calc(100vh - 24px);
  background: #141414;
  color: #ececec;
  border: 1px solid #2f2f2f;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
}

/* the panel must never be a target of its own picker / the site's cursor fx */
#ky-edit-panel, #ky-edit-panel * { cursor: auto; }

/* The global font control emits `body,body *{font-family:… !important}`.
   The id here out-specifies that, so the panel stays monospace while the
   user auditions a serif for the site. */
html.ky-editing #ky-edit-panel,
html.ky-editing #ky-edit-panel *,
html.ky-editing #ky-edit-tab,
html.ky-editing #ky-edit-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
}

.kye-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid #2f2f2f;
  background: #1b1b1b; cursor: grab;
}
.kye-head.kye-drag { cursor: grabbing; }
.kye-title { font-weight: 700; letter-spacing: .10em; font-size: 11px; }
.kye-dot { width: 7px; height: 7px; border-radius: 50%; background: #E3AC33; flex: none; }
.kye-spacer { margin-left: auto; }
.kye-x {
  background: none; border: 1px solid #3a3a3a; color: #bdbdbd;
  width: 22px; height: 22px; border-radius: 6px; line-height: 1;
  font-size: 13px; cursor: pointer;
}
.kye-x:hover { background: #2a2a2a; color: #fff; }

.kye-tabs { display: flex; border-bottom: 1px solid #2f2f2f; background: #181818; }
.kye-tab {
  flex: 1; padding: 8px 4px; background: none; border: 0; color: #8d8d8d;
  font: inherit; font-size: 11px; letter-spacing: .06em; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.kye-tab[aria-selected="true"] { color: #fff; border-bottom-color: #E3AC33; background: #202020; }

.kye-body { padding: 10px 12px 14px; overflow-y: auto; overscroll-behavior: contain; }
.kye-pane[hidden] { display: none; }

.kye-hint { color: #8d8d8d; margin: 2px 0 10px; }
.kye-sel {
  background: #202020; border: 1px solid #2f2f2f; border-radius: 7px;
  padding: 7px 8px; margin-bottom: 10px; word-break: break-all; color: #E3AC33;
  font-size: 11px;
}

.kye-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.kye-row > label { flex: 0 0 78px; color: #a8a8a8; font-size: 11px; }
.kye-row input[type="range"] { flex: 1; min-width: 0; accent-color: #E3AC33; }
.kye-row input[type="number"], .kye-row select, .kye-row input[type="text"] {
  flex: 1; min-width: 0; background: #0e0e0e; color: #ececec;
  border: 1px solid #333; border-radius: 6px; padding: 4px 6px; font: inherit;
}
.kye-row input[type="color"] {
  flex: none; width: 34px; height: 24px; padding: 0; background: #0e0e0e;
  border: 1px solid #333; border-radius: 6px;
}
.kye-num { flex: 0 0 52px !important; text-align: right; }

.kye-grp { margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid #262626; }
.kye-grp:first-of-type { border-top: 0; padding-top: 0; }
.kye-grp > h4 {
  margin: 0 0 6px; font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: #6f6f6f; font-weight: 600;
}

.kye-quad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.kye-quad label { display: block; font-size: 9px; color: #6f6f6f; text-align: center; margin-bottom: 2px; }
.kye-quad input {
  width: 100%; background: #0e0e0e; color: #ececec; border: 1px solid #333;
  border-radius: 5px; padding: 4px 2px; font: inherit; font-size: 11px; text-align: center;
}

.kye-text { width: 100%; min-height: 62px; resize: vertical;
  background: #0e0e0e; color: #ececec; border: 1px solid #333;
  border-radius: 6px; padding: 6px; font: inherit; }

.kye-btn {
  display: block; width: 100%; margin-top: 7px; padding: 8px;
  background: #E3AC33; color: #14110A; border: 0; border-radius: 7px;
  font: inherit; font-weight: 700; letter-spacing: .05em; cursor: pointer;
}
.kye-btn:hover { filter: brightness(1.07); }
.kye-btn.ghost { background: #232323; color: #d8d8d8; border: 1px solid #383838; font-weight: 400; }
.kye-btn.ghost:hover { background: #2c2c2c; }
.kye-btn.danger { background: #3a1f1f; color: #ffb4b4; border: 1px solid #5a2a2a; font-weight: 400; }

.kye-note { color: #7d7d7d; font-size: 10.5px; margin-top: 8px; line-height: 1.5; }
.kye-ok { color: #8ad48a; }

/* ---- picker affordances -------------------------------------------------- */
#ky-edit-hl, #ky-edit-lock {
  position: fixed; z-index: 2147482000; pointer-events: none;
  border-radius: 3px; display: none;
}
#ky-edit-hl { border: 1.5px dashed #E3AC33; background: rgba(227, 172, 51, .10); }
#ky-edit-lock { border: 1.5px solid #35c2f0; background: rgba(53, 194, 240, .08); }
html.ky-picking #ky-edit-hl { display: block; }

#ky-edit-tag {
  position: fixed; z-index: 2147482500; pointer-events: none; display: none;
  background: #E3AC33; color: #14110A; font: 10px/1 ui-monospace, monospace;
  padding: 3px 5px; border-radius: 4px; white-space: nowrap; font-weight: 700;
}
html.ky-picking #ky-edit-tag { display: block; }
html.ky-picking, html.ky-picking * { cursor: crosshair !important; }

/* the site's bespoke cursor would fight the picker */
html.ky-editing .ky-cursor, html.ky-editing #ky-cursor { display: none !important; }

/* a floating re-open handle once the panel is dismissed */
#ky-edit-tab {
  display: none; position: fixed; right: 0; top: 46%; z-index: 2147483000;
  background: #E3AC33; color: #14110A; border: 0; border-radius: 8px 0 0 8px;
  padding: 10px 7px; writing-mode: vertical-rl; letter-spacing: .16em;
  font: 700 10px/1 ui-monospace, monospace; cursor: pointer;
}
html.ky-editing.ky-panel-hidden #ky-edit-tab { display: block; }
html.ky-editing.ky-panel-hidden #ky-edit-panel { display: none; }

/* element being text-edited */
[data-ky-editing-text] { outline: 2px solid #35c2f0 !important; outline-offset: 2px; }
