/* Shared styles for browser-side tools (loaded only on ui: 'custom' pages) */
.ct-root { width: 100%; display: flex; flex-direction: column; gap: 20px; }

.ct-drop {
  width: 100%;
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ct-drop:hover, .ct-drop.over { border-color: var(--primary); background: rgba(215, 255, 58, 0.04); }
.ct-drop-icon {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(215, 255, 58, 0.1); color: var(--primary);
}
.ct-drop h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; color: #fff; margin-bottom: 6px; }
.ct-drop p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.ct-hint { margin-top: 16px; font-size: 0.78rem; color: var(--text-dim); }

.ct-panel { display: flex; flex-direction: column; gap: 18px; width: 100%; }

.ct-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 22px;
  padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}
.ct-field { display: flex; flex-direction: column; gap: 7px; min-width: 150px; flex: 1 1 150px; }
.ct-field > label { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); }
.ct-field input[type="text"], .ct-field input[type="number"], .ct-field textarea, .ct-field select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-hover);
  border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; color: #fff; outline: none;
  font-family: inherit;
}
.ct-field textarea { min-height: 96px; resize: vertical; }
.ct-field input:focus, .ct-field select:focus, .ct-field textarea:focus { border-color: var(--primary); }
.ct-field input[type="range"] { accent-color: var(--primary); width: 100%; }
.ct-field input[type="color"] { width: 100%; height: 40px; border: 1px solid var(--border-hover); border-radius: 10px; background: var(--bg-input); padding: 3px; }
.ct-check { flex-direction: row; align-items: center; gap: 8px; min-width: 0; flex: 0 0 auto; padding-bottom: 8px; }
.ct-check label { color: var(--text-main); font-size: 0.875rem; cursor: pointer; }
.ct-check input { accent-color: var(--primary); width: 16px; height: 16px; }

.ct-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.ct-list { display: flex; flex-direction: column; gap: 10px; }
.ct-item {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card);
}
.ct-item img.ct-thumb, .ct-item canvas.ct-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #000; flex-shrink: 0;
}
.ct-item-main { flex: 1; min-width: 0; }
.ct-item-name { font-size: 0.9rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-item-meta { font-size: 0.78rem; color: var(--text-dim); font-family: var(--font-mono); }
.ct-item-meta .ok { color: var(--primary); }
.ct-icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-hover);
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.ct-icon-btn:hover { color: #fff; border-color: var(--border-hover); background: rgba(255,255,255,0.05); }

.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ct-tile { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-card); display: flex; flex-direction: column; }
.ct-tile canvas, .ct-tile img { width: 100%; height: 170px; object-fit: contain; background: #0d0d0f; display: block; }
.ct-tile-foot { padding: 8px 10px; font-size: 0.78rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }

.ct-status { font-size: 0.875rem; color: var(--text-muted); min-height: 1.2em; }
.ct-status.err { color: var(--accent-rose); }
.ct-progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ct-progress > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.2s ease; }

.ct-result {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px; border: 1px solid rgba(215, 255, 58, 0.3); border-radius: var(--radius-md);
  background: rgba(215, 255, 58, 0.05);
}
.ct-result strong { color: #fff; font-weight: 600; }
.ct-result span { color: var(--text-muted); font-size: 0.85rem; font-family: var(--font-mono); }

.ct-preview { display: flex; justify-content: center; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.ct-preview.dark { background: #0d0d0f; }
.ct-checker { background-image: linear-gradient(45deg,#2a2a2e 25%,transparent 25%),linear-gradient(-45deg,#2a2a2e 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#2a2a2e 75%),linear-gradient(-45deg,transparent 75%,#2a2a2e 75%); background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; background-color: #1c1c1f; }
.ct-preview canvas, .ct-preview img, .ct-preview video { max-width: 100%; height: auto; display: block; }

.ct-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .ct-two { grid-template-columns: 1fr; } .ct-drop { padding: 40px 16px; } }
