/* Editor (/create) */
body.editor { background: #f3ede4; }
.ed { display: grid; grid-template-columns: minmax(360px, 470px) 1fr; min-height: calc(100vh - 64px); }

/* ---- form column ---- */
.ed-form { padding: 22px 22px 120px; border-right: 1px solid var(--line); background: var(--paper); }
.ed-card { margin-bottom: 16px; padding: 18px 18px 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.ed-card > h4, .sec-head { margin: 0 0 14px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ed-intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.ed-intro h1 { font-size: 1.45rem; margin: 0; }

.seg { display: inline-flex; padding: 3px; border-radius: 6px; background: #ece4d8; }
.seg button { padding: 5px 12px; border: 0; border-radius: 4px; background: none; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.sym-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sym { min-width: 44px; height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 5px; background: #fff; cursor: pointer; font-size: 1.15rem; font-family: 'Tiro Devanagari Hindi', serif; }
.sym.txt { font-family: var(--sans); font-size: .85rem; font-weight: 600; }
.sym.on { border-color: var(--maroon); background: #fbf0ef; color: var(--maroon); }

.photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.photo-box { position: relative; flex: none; width: 84px; height: 112px; border: 1px dashed var(--line-2); border-radius: 5px; background: var(--paper) center / cover no-repeat; display: grid; place-items: center; color: var(--ink-3); font-size: .75rem; text-align: center; cursor: pointer; }
.photo-box.has { border-style: solid; color: transparent; }
.photo-row .btns { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* sections */
.sec { margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.sec-top { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); background: #fcfaf6; border-radius: 8px 8px 0 0; }
.sec-title { flex: 1; min-width: 0; padding: 5px 7px; border: 1px solid transparent; border-radius: 4px; background: none; font-family: var(--serif); font-size: 1.08rem; font-weight: 700; color: var(--maroon); }
.sec-title:hover { border-color: var(--line); }
.sec-title:focus { outline: none; border-color: var(--maroon); background: #fff; }
.sec-body { padding: 10px 14px 12px; }
.side-toggle { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-3); margin: 0 0 8px; }

.frow { display: grid; grid-template-columns: 38% 1fr auto; gap: 6px; align-items: start; padding: 4px 0; }
.frow .input { padding: .45em .6em; font-size: .94rem; }
.f-label { color: var(--ink-2); font-weight: 600; background: #fcfaf6; }
.f-val { min-height: 2.15em; height: 2.15em; overflow: hidden; resize: none; line-height: 1.35; }
.f-acts { display: flex; opacity: .35; transition: opacity .15s; }
.frow:hover .f-acts, .frow:focus-within .f-acts { opacity: 1; }
.ico { display: inline-grid; place-items: center; width: 28px; height: 30px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--ink-3); cursor: pointer; }
.ico:hover { background: var(--paper); color: var(--ink); }
.ico.del:hover { color: var(--red); background: #fdeeee; }
.ico svg { width: 16px; height: 16px; }
.add-row { display: flex; gap: 14px; padding-top: 8px; }
.add-field { border: 0; background: none; padding: 4px 0; color: var(--maroon); font-weight: 700; font-size: .9rem; cursor: pointer; }
.add-sec { width: 100%; padding: 12px; border: 1px dashed var(--line-2); border-radius: 8px; background: none; color: var(--ink-2); font-weight: 700; cursor: pointer; }
.add-sec:hover { border-color: var(--maroon); color: var(--maroon); }
.saved-note { font-size: .8rem; color: var(--ink-3); text-align: center; margin-top: 14px; }

/* ---- preview column ---- */
.ed-preview { position: sticky; top: 64px; display: flex; flex-direction: column; height: calc(100vh - 64px); min-width: 0; }
.ed-tpls { display: flex; gap: 10px; padding: 12px 18px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #efe7dc; scrollbar-width: thin; }
.ed-tpl { flex: none; width: 66px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; }
.ed-tpl .thumb { border-radius: 2px; }
.ed-tpl.on { border-color: var(--maroon); }
.ed-tpl span { display: block; margin-top: 3px; font-size: .7rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-stage { position: relative; flex: 1; min-height: 0; padding: 20px; }
.ed-paper-box { position: absolute; top: 20px; left: 50%; transform-origin: 0 0; box-shadow: 0 6px 30px rgba(35, 25, 21, .18); }
.ed-warn { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 6px 12px; border-radius: 5px; background: #fff3cd; color: #7a5208; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.ed-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; background: #fff; border-top: 1px solid var(--line); }
.ed-bar .tname { font-weight: 700; }
.ed-bar .tname small { display: block; font-weight: 400; color: var(--ink-3); }
.ed-bar .pr s { color: var(--ink-3); margin-right: 4px; font-size: .9rem; }

.ed-mob { display: none; }
.ed-close { display: none; }

@media (max-width: 900px) {
  .ed { grid-template-columns: 1fr; }
  .ed-form { border-right: 0; padding: 16px 14px 110px; }
  .ed-preview { display: none; position: fixed; inset: 0; z-index: 60; height: auto; background: #f3ede4; }
  body.show-preview .ed-preview { display: flex; }
  body.show-preview { overflow: hidden; }
  .ed-close { display: inline-flex; }
  .ed-bar { padding: 10px 14px; }
  .ed-bar .tname { display: none; }
  .ed-bar > div { width: 100%; }
  .ed-bar .btn { flex: 1; padding-left: .6em; padding-right: .6em; }
  .ed-bar .pr s { display: none; }
  .user-chip span:last-child { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .ed-mob { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 10px 14px; background: #fff; border-top: 1px solid var(--line); }
  .ed-mob .btn { flex: 1; }
  .frow { grid-template-columns: 1fr auto; }
  .frow .f-label { grid-column: 1 / 2; }
  .frow .f-val { grid-column: 1 / 3; grid-row: 2; }
  .f-acts { opacity: 1; }
}

/* ---- checkout modal ---- */
.ck-sum { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; margin: 14px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.ck-sum b { font-size: 1.25rem; }
.ck-done { text-align: center; }
.ck-done .tick { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: #e3f3e8; color: var(--green); display: grid; place-items: center; }
.ck-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* quick-add field suggestions */
.sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sugg > span { font-size: .78rem; font-weight: 700; color: var(--ink-3); margin-right: 2px; }
.sugg-chip { padding: 3px 10px; border: 1px solid var(--line-2); border-radius: 30px; background: #fff; font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.sugg-chip:hover { border-color: var(--maroon); color: var(--maroon); background: #fbf0ef; }
.frow textarea.f-val { resize: none; }

/* typed field inputs */
.f-pair { display: flex; gap: 6px; }
.f-pair select { flex: 1; min-width: 0; }
.f-selwrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.frow select.input, .frow input[type="date"], .frow input[type="time"] { padding: .42em .5em; font-size: .94rem; min-height: 2.15em; }
@media (max-width: 900px) {
  .frow > :nth-child(2) { grid-column: 1 / 3; grid-row: 2; }
}

/* full-size watermarked preview */
.fp-bg { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: #3b302a; }
.fp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.fp-top b { font-family: var(--serif); font-size: 1.1rem; }
.fp-top .small { display: block; }
.fp-scroll { flex: 1; overflow: auto; padding: 20px 16px 40px; }
.fp-sheet { margin: 0 auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); overflow: hidden; }
.fp-sheet > div { transform-origin: 0 0; }
@media (max-width: 900px) {
  .ed-mob .btn { padding-left: .5em; padding-right: .5em; }
  #full-preview { display: none; }
}

/* checkout promo code */
.ck-sum small { font-weight: 400; }
.ck-sum s { font-weight: 400; margin-right: 4px; }
.ck-promo { margin: 0 0 6px; }
.ck-promo summary { cursor: pointer; color: var(--maroon); font-weight: 700; font-size: .9rem; list-style: none; }
.ck-promo summary::-webkit-details-marker { display: none; }
.ck-promo-row { display: flex; gap: 8px; margin-top: 8px; }
.ck-promo-row .input { text-transform: uppercase; }

/* photo crop dialog */
.pa-modal { max-width: 360px; overflow-x: hidden; }
.pa-view { position: relative; margin: 12px auto 10px; overflow: hidden; border-radius: 6px; background: #ddd; cursor: grab; touch-action: none; user-select: none; }
.pa-view:active { cursor: grabbing; }
.pa-img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.pa-guide { position: absolute; left: 10%; top: 8%; width: 80%; aspect-ratio: 1; border: 2px dashed rgba(255, 255, 255, .9); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
.pa-zoom { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-3); }
.pa-zoom input { flex: 1; accent-color: var(--maroon); }
.pa-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
