/* MonsterLink — app chrome (login, onboarding, editor) */

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 700; }
.input {
  padding: 12px 15px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: #fff; width: 100%; transition: border-color .15s;
}
.input:focus { outline: none; border-color: var(--ink); }
textarea.input { resize: vertical; min-height: 74px; }
select.input { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M5 9l7 7 7-7' fill='none' stroke='%23191621' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 13px center; padding-right: 36px; }
.hint { font-size: 12.5px; color: var(--muted); }
.hint-ok { color: var(--slime-dark); font-weight: 700; }
.hint-bad { color: var(--danger); font-weight: 700; }

/* Panels */
.panel { background: var(--card); border: 1.5px solid var(--line-soft); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-soft); }
.panel + .panel { margin-top: 14px; }
.panel-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Top app bar */
.appbar {
  position: sticky; top: 0; z-index: 60; height: 60px;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgba(250, 247, 240, .92); backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--line-soft);
}
.appbar .spacer { flex: 1; }
.urlpill {
  display: inline-flex; align-items: center; gap: 8px; max-width: 40vw;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden;
}
.urlpill b { font-weight: 800; }
.urlpill:hover { border-color: var(--ink); }
.avatar-chip { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); cursor: pointer; }

/* Editor layout */
.ed-grid {
  display: grid; grid-template-columns: minmax(360px, 430px) 1fr 300px;
  gap: 22px; padding: 22px; max-width: 1360px; margin: 0 auto; align-items: start;
}
.ed-preview { position: sticky; top: 82px; display: flex; justify-content: center; }
.ed-col { min-width: 0; }

/* Block rows */
.blist { display: flex; flex-direction: column; gap: 9px; }
.brow {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: #fff; border: 1.5px solid var(--line-soft); border-radius: var(--r-md);
  transition: box-shadow .15s, border-color .15s, opacity .2s;
}
.brow:hover { border-color: var(--line); box-shadow: var(--shadow-soft); }
.brow.dragging { opacity: .35; }
.brow.drop-above { box-shadow: 0 -3px 0 var(--slime-deep); }
.brow.drop-below { box-shadow: 0 3px 0 var(--slime-deep); }
.brow-grip { cursor: grab; color: var(--muted); padding: 4px 2px; touch-action: none; flex: none; }
.brow-grip:active { cursor: grabbing; }
.brow-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--paper); border-radius: 10px; font-size: 16px; }
.brow-main { flex: 1; min-width: 0; cursor: pointer; }
.brow-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow-sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.brow-hidden .brow-title, .brow-hidden .brow-icon { opacity: .4; }
.brow-clicks { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--paper); padding: 4px 9px; border-radius: 999px; }
.brow-menu-btn { flex: none; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-weight: 800; letter-spacing: 1px; }
.brow-menu-btn:hover { background: var(--paper); color: var(--ink); }
.chip-sched { font-size: 11px; background: var(--peach); color: var(--ink); border-radius: 999px; padding: 1px 8px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; vertical-align: 1px; }

/* Popover menu */
.popmenu {
  position: fixed; z-index: 120; min-width: 170px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(25,22,33,.18); padding: 6px;
}
.popmenu button { display: flex; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; gap: 9px; align-items: center; }
.popmenu button svg { flex: none; opacity: .72; }
.popmenu button:hover { background: var(--paper); }
.popmenu button.danger { color: var(--danger); }
.popmenu hr { border: 0; border-top: 1.5px solid var(--line-soft); margin: 5px 4px; }

/* Modal + sheet */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(25, 22, 33, .45); display: grid; place-items: center; padding: 18px; }
.modal { background: var(--paper); border-radius: var(--r-lg); width: min(560px, 100%); max-height: 88dvh; overflow: auto; padding: 22px; }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.modal-x { font-size: 17px; padding: 6px 10px; border-radius: 10px; }
.modal-x:hover { background: var(--paper-2); }
.sheet { position: fixed; inset: 0 0 0 auto; z-index: 110; width: min(430px, 100vw); background: var(--paper); box-shadow: -20px 0 60px rgba(25,22,33,.2); padding: 20px; overflow-y: auto; animation: sheet-in .22s ease; }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }

/* Add block grid */
.addgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addgrid button {
  display: flex; gap: 11px; align-items: flex-start; text-align: left;
  background: #fff; border: 1.5px solid var(--line-soft); border-radius: var(--r-md); padding: 13px;
  transition: border-color .15s, transform .15s;
}
.addgrid button:hover { border-color: var(--ink); transform: translateY(-1px); }
.addgrid .ico { width: 34px; height: 34px; display: grid; place-items: center; background: var(--paper); border-radius: 10px; flex: none; }
.addgrid b { display: block; font-size: 14px; }
.addgrid span.blurb { font-size: 12px; color: var(--muted); }

/* Theme swatches */
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.swatch { border-radius: 14px; overflow: hidden; border: 2px solid var(--line-soft); padding: 0; transition: transform .15s, border-color .15s; }
.swatch:hover { transform: translateY(-2px); }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--slime); }
.swatch-body { padding: 11px 8px 9px; display: flex; flex-direction: column; align-items: center; gap: 5px; background: var(--pg-bg); color: var(--pg-text); }
.swatch-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--pg-btn-bg); border: var(--pg-border-w) solid var(--pg-btn-border); box-shadow: var(--pg-btn-shadow); }
.swatch-bar { width: 76%; height: 9px; border-radius: 99px; background: var(--pg-btn-bg); border: var(--pg-border-w) solid var(--pg-btn-border); }
.swatch-name { font-size: 10.5px; font-weight: 800; }

/* Segmented control */
.seg { display: flex; background: var(--paper-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 7px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(25,22,33,.12); }

/* Switch */
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--slime-deep); }
.switch input:checked + i::after { transform: translateX(16px); }

/* Item editors (faq/testimonial/carousel rows) */
.itemed { border: 1.5px solid var(--line-soft); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; background: #fff; }
.itemed-top { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 6px; }
.itemed-top button { font-size: 12px; padding: 4px 8px; border-radius: 8px; color: var(--muted); font-weight: 700; }
.itemed-top button:hover { background: var(--paper); color: var(--ink); }

/* Image pickers */
.imgpick { display: flex; align-items: center; gap: 12px; }
.imgpick-thumb { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--paper-2); border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: 22px; overflow: hidden; flex: none; }
.imgpick-thumb img { width: 100%; height: 100%; object-fit: cover; }
.imggrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.imggrid .cell { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--paper-2); }
.imggrid .cell img { width: 100%; height: 100%; object-fit: cover; }
.imggrid .cell .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(25,22,33,.8); color: #fff; font-size: 11px; display: grid; place-items: center; }
.imggrid .add { border: 1.5px dashed var(--line); display: grid; place-items: center; font-size: 20px; color: var(--muted); border-radius: 10px; aspect-ratio: 1; }

/* Stats */
.stats-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 12px; }
.stat { background: var(--paper); border-radius: var(--r-md); padding: 11px 12px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 20px; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.statrow { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 6px 0; }
.statrow .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.statrow .bar { height: 7px; border-radius: 99px; background: var(--slime); min-width: 4px; border: 1px solid rgba(25,22,33,.25); }
.statrow .n { font-weight: 800; font-size: 12.5px; width: 34px; text-align: right; }

/* Save indicator */
.savebadge { font-size: 12.5px; font-weight: 700; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.savebadge.saving { color: var(--grape); }
.savebadge.saved { color: var(--slime-dark); }

/* Auth + onboarding shells */
.authwrap { min-height: 100dvh; display: grid; place-items: center; padding: 22px; }
.authcard { width: min(420px, 100%); background: #fff; border: 2px solid var(--ink); border-radius: var(--r-lg); padding: 28px; box-shadow: 8px 8px 0 var(--slime); }
.authcard h1 { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.02em; margin-bottom: 4px; }
.authcard .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.ob-shell { display: grid; grid-template-columns: 1fr 480px; min-height: 100dvh; }
.ob-main { padding: 26px clamp(18px, 6vw, 70px) 120px; max-width: 720px; margin: 0 auto; width: 100%; }
.ob-side { background: linear-gradient(160deg, #EFE9DB, #E4DECE); display: flex; align-items: center; justify-content: center; position: sticky; top: 0; height: 100dvh; }
.steps { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 10px 0 30px; }
.steps .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 2px solid var(--line); color: var(--muted); background: #fff; }
.steps .dot.on { background: var(--ink); border-color: var(--ink); color: var(--slime); }
.steps .dot.done { background: var(--slime); border-color: var(--ink); color: var(--ink); }
.steps .bar2 { width: 26px; height: 2px; background: var(--line); }
.ob-h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.02em; text-align: center; }
.ob-sub { text-align: center; color: var(--muted); margin: 6px 0 26px; }
.ob-foot { position: fixed; bottom: 0; left: 0; right: 480px; padding: 14px clamp(18px, 6vw, 70px); background: linear-gradient(transparent, var(--paper) 40%); display: flex; gap: 10px; justify-content: space-between; z-index: 40; }

/* Section picker rows */
.secrow { display: flex; gap: 13px; align-items: center; width: 100%; text-align: left; background: #fff; border: 2px solid var(--line-soft); border-radius: var(--r-md); padding: 15px; margin-bottom: 10px; transition: border-color .15s; }
.secrow:hover { border-color: var(--line); }
.secrow.on { border-color: var(--ink); }
.secrow .ico { width: 38px; height: 38px; display: grid; place-items: center; background: var(--paper); border-radius: 11px; flex: none; }
.secrow b { display: block; font-size: 15px; }
.secrow span.blurb { font-size: 13px; color: var(--muted); }
.secrow .tick { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.secrow.on .tick { background: var(--ink); border-color: var(--ink); color: var(--slime); }

/* Mobile tab bar + responsive editor */
.tabbar { display: none; }
@media (max-width: 1080px) {
  .ed-grid { grid-template-columns: minmax(340px, 1fr) 1fr; }
  .ed-style { grid-column: 1; }
  .ed-preview { grid-row: 1 / span 3; grid-column: 2; }
}
@media (max-width: 800px) {
  .ed-grid { display: block; padding: 14px 14px 90px; }
  .ed-preview { position: static; margin-bottom: 16px; display: none; }
  .ed-col, .ed-style { display: none; }
  body[data-tab="content"] #colContent { display: block; }
  body[data-tab="style"] .ed-style { display: block; }
  body[data-tab="style"] .ed-style .ed-stats-panel { display: none; }
  body[data-tab="stats"] .ed-style { display: block; }
  body[data-tab="stats"] .ed-style .panel:not(.ed-stats-panel) { display: none; }
  body[data-tab="preview"] .ed-preview { display: flex; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: rgba(250,247,240,.95); backdrop-filter: blur(10px);
    border-top: 1.5px solid var(--line-soft); padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 2px; border-radius: 12px; }
  .tabbar button.on { color: var(--ink); background: var(--paper-2); }
  .tabbar .tico { height: 18px; }
  .tabbar .tico svg { display: block; }
  .ob-shell { grid-template-columns: 1fr; }
  .ob-side { display: none; }
  .ob-foot { right: 0; }
  .urlpill { display: none; }
  .stats-tiles { grid-template-columns: repeat(3, 1fr); }
  .sheet { width: 100vw; }
}
