/* /public/styles/actions/comments.css */

.cm-btn{
  appearance:none;
  border:1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  cursor:pointer;
  display:inline-flex;
  gap:8px;
  align-items:center;
  font-weight:800;
  font-size: 13px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.cm-btn:active{
  transform: translateY(1px);
}

.cm-ico{
  width:18px;
  height:18px;
  display:block;
  flex: 0 0 auto;
}
.cm-ico path{
  fill: currentColor !important;
}

.cm-count{
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
}

.cm-modal[hidden]{ display:none; }
.cm-modal{
  position: fixed;
  inset: 0;
  z-index: 20000;
}

.cm-backdrop{
  position:absolute;
  inset:0;
  background: color-mix(in oklab, #000, transparent 55%);
}

.cm-panel{
  position:absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(460px, 100%);
  background: var(--surface);
  color: var(--text);
  border-left: 1px solid var(--border);
  display:flex;
  flex-direction:column;

  /* важно: sheet будет внутри панели */
  overflow: hidden;
}

.cm-head{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.cm-title{ font-weight:900; }

.cm-close{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  cursor:pointer;
  font-weight:900;
}

.cm-body{
  padding: 12px;
  overflow:auto;
  flex: 1 1 auto;
}

.cm-item{
  border: 1px solid var(--border);
  background: var(--surface-elev);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;

  -webkit-tap-highlight-color: transparent;
}

.cm-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  color: var(--muted);
  font-size: 12px;
}

.cm-text{
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.cm-actions{
  margin-top: 8px;
  display:flex;
  gap:10px;
}

.cm-reply{
  border:0;
  background: transparent;
  color: var(--brand);
  cursor:pointer;
  font-weight:800;
}

.cm-form{
  border-top: 1px solid var(--border);
  padding: 10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.cm-form textarea{
  width:100%;
  min-height: 60px;
  resize: vertical;
  border: 1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
  outline:none;
}

.cm-form-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  align-items:center;
}

.cm-send{
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--brand), var(--surface) 70%);
  color: var(--heading);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight:900;
  cursor:pointer;
}

.cm-cancel-reply{
  border:0;
  background: transparent;
  color: var(--muted);
  cursor:pointer;
  font-weight:800;
}

/* маленькая пометка “изменено” в мета */
.cm-meta .cm-edited{
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface-elev), transparent 0%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

/* =========================
   Запрет выделения в списке комментариев
   ========================= */
.cm-body, .cm-body *{
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* но в форме ввода выделение нужно */
.cm-form, .cm-form *{
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* чтобы свайп/скролл работали нормально */
.cm-body{
  touch-action: pan-y;
}
.cm-item{
  touch-action: pan-y;
}

/* =========================
   Bottom sheet (actions) — ВНУТРИ панели чата
   ========================= */

.cm-item--pressed{
  outline: 2px solid color-mix(in oklab, var(--brand), transparent 55%);
  outline-offset: 2px;
}

.cm-sheet[hidden]{ display:none; }
.cm-sheet{
  position: absolute;   /* важно: не fixed */
  inset: 0;
  z-index: 50;
}

.cm-sheet .cm-backdrop{
  position:absolute;
  inset:0;
  background: color-mix(in oklab, #000, transparent 60%);
}

.cm-sheet-panel{
  position:absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 45%;
  min-height: 220px;
  max-height: 520px;

  background: var(--surface);
  color: var(--text);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,.35);

  display:flex;
  flex-direction:column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.cm-sheet-handle{
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted), transparent 35%);
  margin: 10px auto 8px auto;
}

.cm-sheet-body{
  padding: 10px 12px 12px 12px;
  overflow:auto;
}

.cm-sheet-title{
  font-weight: 900;
  margin-bottom: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.cm-sheet-sub{
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.cm-menu{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.cm-menu-btn{
  appearance:none;
  border: 1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 12px;
  cursor:pointer;
  font-weight: 900;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.cm-menu-btn:active{
  transform: translateY(1px);
}

.cm-menu-btn.danger{
  border-color: color-mix(in oklab, #ff3b30, var(--border) 70%);
  background: color-mix(in oklab, #ff3b30, var(--surface-elev) 88%);
}

.cm-menu-btn.primary{
  border-color: color-mix(in oklab, var(--brand), var(--border) 70%);
  background: color-mix(in oklab, var(--brand), var(--surface-elev) 85%);
  color: var(--heading);
}

.cm-inline{
  display:flex;
  gap:10px;
  margin-top: 10px;
}
.cm-inline > *{
  flex: 1 1 auto;
}

.cm-input, .cm-select{
  width:100%;
  border: 1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
  outline:none;
}

.cm-help{
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
