/* =============================================================================
 * editor.css — personal info editor (Module 3)
 * ========================================================================== */

/* ---------------------------------------------------------------- toggle */

.oe-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 8px, 0);
  z-index: 9400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #00000014;
  border-radius: 999px;
  background: #ffffffe8;
  color: var(--ink, #1a1a1a);
  box-shadow: 0 4px 10px #0000000d, 0 16px 40px -18px #00000033;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: width .42s var(--ease, cubic-bezier(.19, 1, .22, 1)),
    background .3s ease, transform .3s var(--ease, cubic-bezier(.19, 1, .22, 1)),
    box-shadow .3s ease;
}

.oe-toggle.is-visible {
  opacity: .92;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}
.oe-toggle:hover,
.oe-toggle:focus-visible {
  width: 84px;
  opacity: 1;
  background: var(--hl, #ffe28a);
  border-color: #0000001f;
  box-shadow: 0 4px 10px #00000012, 0 22px 44px -18px #00000040;
}
.oe-toggle:active { transform: scale(.96); }
.oe-toggle:focus-visible { opacity: 1; }
.oe-toggle[hidden] { display: none !important; }
.oe-hotzone {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 9390;
  width: 150px;
  height: 130px;
}
.oe-footer-link {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  opacity: .8;
  transition: color .3s var(--ease), opacity .3s ease;
}
.oe-footer-link:hover { color: var(--ink, #1a1a1a); opacity: 1; }
.oe-toggle svg { flex: none; }
.oe-toggle-label {
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font: 600 12px/1 var(--font-sans, -apple-system, sans-serif);
  letter-spacing: .04em;
  transition: max-width .42s var(--ease, cubic-bezier(.19, 1, .22, 1)),
    opacity .25s ease, margin-left .42s var(--ease, cubic-bezier(.19, 1, .22, 1));
}
.oe-toggle:hover .oe-toggle-label,
.oe-toggle:focus-visible .oe-toggle-label {
  max-width: 44px;
  margin-left: 6px;
  opacity: 1;
}

/* ---------------------------------------------------------------- shell */

.oe {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  justify-content: flex-end;
}
.oe[hidden] { display: none !important; }

.oe-backdrop {
  position: absolute;
  inset: 0;
  background: #00000024;
  opacity: 0;
  transition: opacity .4s ease;
}
.oe.is-open .oe-backdrop { opacity: 1; }

.oe-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(432px, 100%);
  height: 100%;
  border-left: 1px solid #00000012;
  background: #fffffff7;
  box-shadow: -30px 0 70px -30px #00000033;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform: translate3d(102%, 0, 0);
  transition: transform .42s var(--ease, cubic-bezier(.19, 1, .22, 1));
  outline: none;
}
.oe.is-open .oe-panel { transform: translate3d(0, 0, 0); }

body.oe-open { overflow: hidden; }

/* ---------------------------------------------------------------- head */

.oe-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line, #e8e8e8);
}
.oe-title-wrap { min-width: 0; }
.oe-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--t3, #999);
  font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .22em;
}
.oe-title {
  margin: 0;
  color: var(--ink, #1a1a1a);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.oe-close {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 50%;
  background: #fff;
  color: var(--ink, #1a1a1a);
  font: 400 22px/1 var(--font-sans, sans-serif);
  cursor: pointer;
  transition: background .25s ease, transform .3s var(--ease);
}
.oe-close:hover { background: var(--hl, #ffe28a); transform: rotate(90deg); }

/* ---------------------------------------------------------------- tabs */

.oe-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 10px 14px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line, #e8e8e8);
}
.oe-tabs::-webkit-scrollbar { display: none; }
.oe-tab {
  position: relative;
  flex: none;
  padding: 9px 11px 11px;
  border: 0;
  background: none;
  color: var(--t3, #999);
  font: 500 12.5px/1 var(--font-sans, sans-serif);
  letter-spacing: .01em;
  cursor: pointer;
  transition: color .25s ease;
}
.oe-tab:after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink, #1a1a1a);
  transform: scaleX(0);
  transition: transform .4s var(--ease);
}
.oe-tab:hover { color: var(--ink, #1a1a1a); }
.oe-tab.is-active { color: var(--ink, #1a1a1a); font-weight: 650; }
.oe-tab.is-active:after { transform: scaleX(1); }

/* ---------------------------------------------------------------- scroll */

.oe-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 22px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.oe-scroll::-webkit-scrollbar { width: 8px; }
.oe-scroll::-webkit-scrollbar-thumb { background: #0000001a; border-radius: 8px; }

.oe-section { margin-bottom: 26px; }
.oe-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  color: var(--ink, #1a1a1a);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.oe-section-title:before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid var(--ink, #1a1a1a);
  border-radius: 50%;
  background: var(--hl, #ffe28a);
}
.oe-section-hint,
.oe-hint {
  margin: 0 0 12px;
  color: #767676;
  font-size: 11.5px;
  line-height: 1.65;
}
.oe-hint { margin: -4px 0 10px; }

/* ---------------------------------------------------------------- fields */

.oe-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.oe-label {
  color: #767676;
  font: 600 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
}
.oe-input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 8px;
  background: #fff;
  color: var(--ink, #1a1a1a);
  font: 400 13px/1.45 var(--font-sans, sans-serif);
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.oe-input:hover { border-color: #d6d6d6; }
.oe-input:focus {
  border-color: var(--ink, #1a1a1a);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl, #ffe28a) 62%, transparent);
}
.oe-input::placeholder { color: #bdbdbd; }
textarea.oe-input {
  min-height: 66px;
  resize: vertical;
  line-height: 1.65;
}
select.oe-input { cursor: pointer; }
input.oe-color {
  width: 100%;
  height: 38px;
  padding: 3px;
  cursor: pointer;
  background: #fff;
}
input.oe-color::-webkit-color-swatch-wrapper { padding: 0; }
input.oe-color::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}
.oe-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--t2, #555);
  font-size: 12.5px;
  cursor: pointer;
}
.oe-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ink, #1a1a1a);
}

/* ---------------------------------------------------------------- buttons */

.oe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 9px;
  background: #fff;
  color: var(--ink, #1a1a1a);
  font: 600 12px/1 var(--font-sans, sans-serif);
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .22s ease, border-color .22s ease, transform .2s ease;
}
.oe-btn:hover { background: #fafafa; border-color: #d4d4d4; }
.oe-btn:active { transform: scale(.98); }
.oe-btn:focus-visible,
.oe-tab:focus-visible,
.oe-preset:focus-visible,
.oe-close:focus-visible,
.oe-toggle:focus-visible {
  outline: 2px solid var(--ink, #1a1a1a);
  outline-offset: 2px;
}
.oe-btn--primary {
  border-color: var(--ink, #1a1a1a);
  background: var(--ink, #1a1a1a);
  color: #fff;
}
.oe-btn--primary:hover { background: #333; }
.oe-btn--ghost { background: #fff; }
.oe-btn--small { min-height: 28px; padding: 0 9px; font-size: 11px; }
.oe-btn--danger { color: #b42318; }
.oe-btn--danger:hover { background: #fff4f2; border-color: #f0c2bd; }

.oe-row { display: flex; gap: 8px; align-items: center; }
.oe-row > * { flex: 1; }

/* ---------------------------------------------------------------- lists */

.oe-list { display: grid; gap: 9px; margin-bottom: 10px; }
.oe-item {
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 11px;
  background: #fff;
  overflow: clip;
}
.oe-item-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.oe-item-summary::-webkit-details-marker { display: none; }
.oe-item-summary:hover { background: #fcfcfc; }
.oe-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.oe-card-no {
  flex: none;
  color: var(--t3, #999);
  font: 500 9.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.oe-card-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink, #1a1a1a);
  font-size: 12.5px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oe-item summary .oe-btn { flex: none; }
.oe-item-body {
  padding: 12px 12px 4px;
  border-top: 1px solid var(--line, #e8e8e8);
}
.oe-item--flat .oe-item-body { border-top: 1px solid var(--line, #e8e8e8); }

/* ---------------------------------------------------------------- presets */

.oe-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.oe-preset {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 9px;
  background: var(--swatch-bg, #fff);
  color: var(--ink, #1a1a1a);
  font: 500 11px/1 var(--font-sans, sans-serif);
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.oe-preset:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 10px #0000000a;
  transform: translateY(-1px);
}
.oe-preset-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border: 1px solid #0000001f;
  border-radius: 50%;
  background: var(--swatch, #ffe28a);
}
.oe-preset-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- foot */

.oe-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 22px;
  border-top: 1px solid var(--line, #e8e8e8);
  background: #ffffffd9;
}
.oe-saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #767676;
  font: 500 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  transition: color .25s ease;
}
.oe-saved:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d6d6d6;
  transition: background .25s ease;
}
.oe-saved.is-live { color: var(--ink, #1a1a1a); }
.oe-saved.is-live:before { background: var(--hl, #ffe28a); border: 1px solid var(--ink); }
.oe-foot-hint {
  color: #767676;
  font: 400 10px/1.3 var(--font-sans, sans-serif);
  letter-spacing: .01em;
  text-align: right;
}

.oe-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 760px) {
  .oe-panel {
    width: 100%;
    border-left: 0;
    border-radius: 0;
    background: #fffffff7;
  }
  .oe-head {
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px 12px;
  }
  .oe-tabs { padding: 8px 10px 0; }
  .oe-tab { padding: 10px 12px 12px; font-size: 13px; }
  .oe-scroll {
    padding: 16px 18px calc(env(safe-area-inset-bottom, 0px) + 30px);
  }
  .oe-foot {
    padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 10px);
  }
  .oe-foot-hint { display: none; }
  .oe-input { font-size: 16px; padding: 11px 10px; }
  .oe-btn { min-height: 42px; }
  .oe-btn--small { min-height: 32px; }
  .oe-toggle {
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    width: 42px;
    height: 42px;
  }
  .oe-toggle:hover,
  .oe-toggle:focus-visible { width: 42px; background: #ffffffe8; }
  .oe-toggle-label { display: none; }
  .oe-hotzone { display: none; }
  .oe-toggle.is-visible { opacity: .9; }
  .oe-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .oe-panel,
  .oe-backdrop,
  .oe-toggle,
  .oe-tab:after,
  .oe-toggle-label { transition-duration: .01ms !important; }
}

/* Keep the page identical when the editor is closed. */
body:not(.oe-open) .oe { display: none !important; }
/* The site hides the native cursor (custom arrow). Restore it inside the editor. */
html.has-cursor-fx .oe-toggle,
html.has-cursor-fx .oe-panel,
html.has-cursor-fx .oe-panel * { cursor: auto !important; }
html.has-cursor-fx .oe-toggle,
html.has-cursor-fx .oe-panel button,
html.has-cursor-fx .oe-panel summary,
html.has-cursor-fx .oe-panel select,
html.has-cursor-fx .oe-panel input[type="checkbox"],
html.has-cursor-fx .oe-panel input[type="color"],
html.has-cursor-fx .oe-panel input[type="file"] { cursor: pointer !important; }
html.has-cursor-fx .oe-panel input[type="text"],
html.has-cursor-fx .oe-panel input[type="url"],
html.has-cursor-fx .oe-panel input[type="email"],
html.has-cursor-fx .oe-panel textarea { cursor: text !important; }
