/* ============================================================
   EDIT MODE + DEVICE PREVIEW
   - Inline text editing overlay (Tweaks toggle)
   - Mobile/Desktop preview frame
   ============================================================ */

/* -----------------------------------------------------------
   EDIT MODE TOOLBAR (floating, top-right)
   ----------------------------------------------------------- */
.edit-toolbar {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 200;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  font-family: var(--mono);
}
.edit-toolbar.visible { display: flex; }

/* Always-visible floating edit launcher (bottom-right pill) */
.edit-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 210;
  background: var(--acid, #c9a24a);
  color: var(--bg, #1a1814);
  border: 1px solid var(--acid, #c9a24a);
  padding: 12px 18px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.edit-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.42), 0 3px 8px rgba(0,0,0,0.25);
}
.edit-fab.active {
  background: #d97a5c;
  border-color: #d97a5c;
  color: #fff;
}
.edit-fab .ico {
  width: 14px;
  height: 14px;
  display: inline-block;
}
.edit-fab .ico svg { width: 100%; height: 100%; display: block; }

/* When save bar is visible, nudge the FAB above it */
.edit-save-bar.visible ~ .edit-fab {
  bottom: 78px;
}

.edit-toolbar-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--acid);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.edit-toolbar-title .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--acid);
  animation: blink 1.4s infinite;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.edit-toolbar-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.edit-btn {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  text-align: center;
}
.edit-btn:hover { border-color: var(--acid); color: var(--acid); }
.edit-btn.active {
  background: var(--acid);
  color: var(--bg);
  border-color: var(--acid);
}

.edit-toolbar-help {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-dim);
  line-height: 1.6;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.edit-toolbar-help kbd {
  background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--acid);
}

/* -----------------------------------------------------------
   EDITABLE ELEMENTS
   ----------------------------------------------------------- */
body.edit-mode [data-editable] {
  position: relative;
  outline: 1px dashed rgba(201, 162, 74, 0.34);
  outline-offset: 3px;
  cursor: text;
  transition: outline-color 0.12s, background 0.12s;
  border-radius: 2px;
}
body.edit-mode [data-editable]:hover {
  outline: 1px dashed var(--acid);
  outline-offset: 3px;
  background: rgba(201, 162, 74, 0.07);
}
body.edit-mode [data-editable]:focus {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
  background: rgba(201, 162, 74, 0.10);
  cursor: text;
}
body.edit-mode [data-editable][contenteditable="true"] {
  cursor: text;
}

/* Small marker showing element type */
body.edit-mode [data-editable]::before {
  content: attr(data-editable-label);
  position: absolute;
  top: -20px;
  left: 0;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--acid);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(201, 162, 74, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  white-space: nowrap;
  z-index: 5;
}
body.edit-mode [data-editable]:hover::before,
body.edit-mode [data-editable]:focus::before {
  opacity: 1;
}

/* Prevent buttons from being triggered while editing */
body.edit-mode .cat-card,
body.edit-mode [data-open] {
  pointer-events: none;
}
body.edit-mode [data-editable] {
  pointer-events: auto;
}
/* Keep panel headers usable (BACK / CLOSE) so user can navigate panels while editing */
body.edit-mode .panel-back,
body.edit-mode .panel-close {
  pointer-events: auto;
}

/* Edit-mode save/reset banner */
.edit-save-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--bg-2);
  border: 1px solid var(--acid);
  border-radius: 100px;
  padding: 10px 16px 10px 22px;
  display: none;
  align-items: center;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.edit-save-bar.visible { display: flex; }
.edit-save-bar .msg {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--acid);
}
.edit-save-bar button {
  background: var(--acid);
  color: var(--bg);
  border: none;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 700;
}
.edit-save-bar button.secondary {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.edit-save-bar button.secondary:hover { color: var(--ink); border-color: var(--ink); }

/* -----------------------------------------------------------
   DEVICE PREVIEW — Mobile frame
   ----------------------------------------------------------- */
body.device-mobile {
  background: #0a0806;
  overflow: hidden;
}

body.device-mobile .device-viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 20%, rgba(201, 162, 74, 0.06), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(217, 122, 92, 0.04), transparent 50%),
    #0a0806;
}

body.device-mobile .device-frame {
  width: 390px;
  height: 844px;
  border: 12px solid #0a0a0a;
  border-radius: 48px;
  box-shadow:
    0 0 0 2px #1c1b17,
    0 40px 80px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(201, 162, 74, 0.10);
  overflow: hidden;
  position: relative;
  background: var(--bg);
  flex-shrink: 0;
}

/* Notch */
body.device-mobile .device-frame::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 26px;
  background: #0a0806;
  border-radius: 20px;
  z-index: 100;
}

/* Content wrapper inside frame — scrollable */
body.device-mobile .device-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 44px; /* status bar space */
  background: var(--bg);
  scrollbar-width: none;
}
body.device-mobile .device-scroll::-webkit-scrollbar { display: none; }

/* Force page + nav to render as if 390px viewport */
body.device-mobile .page {
  width: 390px;
  max-width: 390px;
  min-height: 800px;
}
body.device-mobile .nav {
  position: sticky;
  top: 0;
  width: 100%;
}
body.device-mobile .nav-inner {
  padding: 12px 18px;
}
body.device-mobile .nav-links {
  gap: 12px;
}
body.device-mobile .nav-links a:not(.nav-cta):not(.lang-toggle) {
  display: none;
}
body.device-mobile .lang-toggle {
  display: none !important;
}
body.device-mobile .brand img { width: 34px; height: 34px; }
body.device-mobile .brand-text .kr { font-size: 16px; }
body.device-mobile .brand-text .en { font-size: 8px; }
body.device-mobile .nav-cta {
  padding: 8px 14px !important;
  font-size: 10px !important;
}

/* Main dashboard adjustments */
body.device-mobile .main-view {
  padding: 24px 0 40px;
}
body.device-mobile .container {
  padding: 0 18px;
  max-width: 100%;
}
body.device-mobile .main-grid {
  grid-template-columns: 1fr !important;
  gap: 28px;
}
body.device-mobile .hero-block {
  min-height: auto;
  gap: 24px;
  padding: 8px 0 0;
}
body.device-mobile .hero-display {
  font-size: 44px !important;
  line-height: 0.95;
}
body.device-mobile .hero-sub {
  font-size: 14px;
}
body.device-mobile .hero-top-meta {
  font-size: 9px;
  gap: 8px;
}
body.device-mobile .hero-top-meta .right { font-size: 8px; }
body.device-mobile .hero-cta-row .btn {
  padding: 13px 18px;
  font-size: 10px;
  flex: 1;
}
body.device-mobile .hero-trust {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 20px;
  margin-top: 12px;
}
body.device-mobile .hero-trust-item {
  padding: 12px 4px 12px 0;
  border-right: none;
  border-bottom: 1px solid var(--line);
}
body.device-mobile .hero-trust-item:nth-last-child(-n+2) { border-bottom: none; }
body.device-mobile .hero-trust-item .v { font-size: 20px; }

body.device-mobile .card-grid {
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: auto !important;
  gap: 10px;
  min-height: auto;
}
body.device-mobile .cat-card {
  min-height: 190px;
  padding: 18px 16px 16px;
}
body.device-mobile .cat-title {
  font-size: 22px !important;
}
body.device-mobile .cat-desc {
  font-size: 11px;
  margin-top: 8px;
}
body.device-mobile .cat-icon {
  width: 34px;
  height: 34px;
}
body.device-mobile .cat-icon svg { width: 16px; height: 16px; }
body.device-mobile .cat-num { font-size: 9px; }
body.device-mobile .cat-title-en { font-size: 8px; }
body.device-mobile .cat-arrow { top: 18px; right: 16px; font-size: 12px; }

/* Bottom info strip */
body.device-mobile .main-view > div:last-child {
  flex-direction: column;
  gap: 6px !important;
  align-items: flex-start !important;
  font-size: 8px !important;
  margin-top: 32px !important;
  padding-top: 18px !important;
}

/* Panels — become full-frame */
body.device-mobile .detail-panel {
  position: absolute !important;
  inset: 0;
}
body.device-mobile .panel-header {
  padding: 14px 18px;
}
body.device-mobile .panel-back,
body.device-mobile .panel-close {
  padding: 8px 12px;
  font-size: 9px;
}
body.device-mobile .panel-crumb {
  font-size: 8px;
  letter-spacing: 0.18em;
}
body.device-mobile .panel-body {
  padding: 32px 18px 60px;
}
body.device-mobile .panel-lead {
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 28px;
}
body.device-mobile .panel-title {
  font-size: 44px !important;
  line-height: 0.94;
}
body.device-mobile .panel-lead-desc { font-size: 14px; }
body.device-mobile .about-meta-panel {
  grid-template-columns: 1fr 1fr;
}
body.device-mobile .about-meta-cell { padding: 20px 16px 22px; }
body.device-mobile .about-meta-cell .v { font-size: 14px; }
body.device-mobile .points-mini {
  grid-template-columns: 1fr;
}
body.device-mobile .point-mini { min-height: auto; padding: 24px 18px 28px; }
body.device-mobile .svc-grid-panel { grid-template-columns: 1fr; }
body.device-mobile .svc-card-panel { padding: 28px 20px 30px; }
body.device-mobile .svc-title { font-size: 32px; }
body.device-mobile .process-list { grid-template-columns: 1fr 1fr; }
body.device-mobile .reviews-hero { grid-template-columns: 1fr 1fr; }
body.device-mobile .reviews-hero-cell .v { font-size: 28px; }
body.device-mobile .reviews-grid-panel { grid-template-columns: 1fr; }
body.device-mobile .contact-hero { grid-template-columns: 1fr; gap: 16px; }
body.device-mobile .contact-phone { font-size: 56px !important; }
body.device-mobile .contact-channels { grid-template-columns: 1fr 1fr; }
body.device-mobile .contact-form {
  grid-template-columns: 1fr;
  padding: 24px 18px;
}
body.device-mobile .contact-form h3 { font-size: 22px; }
body.device-mobile .subsection-title { font-size: 24px !important; }
body.device-mobile .section-note {
  text-align: left !important;
  font-size: 9px !important;
}

body.device-mobile .panel-footer {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
body.device-mobile .panel-footer > div {
  width: 100%;
}
body.device-mobile .panel-footer .btn {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  padding: 12px 14px;
}

/* Hide toolbar behavior in mobile — keep it fixed to viewport, not frame */
body.device-mobile .edit-toolbar { top: auto; bottom: 24px; right: 24px; }
