/* ─── CROP MODAL ─── */
.crop-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 600; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  backdrop-filter: blur(12px);
}
.crop-overlay.open { display: flex; }
.crop-modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 24px; width: 90vw; max-width: 820px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), var(--glow-blue);
}
.crop-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.crop-modal-header h2 { font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 800; }
.crop-close { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; color: var(--text2); }
.crop-close:hover { color: var(--text); background: var(--surface); }

.crop-workspace {
  position: relative; overflow: hidden; background: #111;
  border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  min-height: 360px; max-height: 60vh;
  user-select: none;
}
.crop-workspace img {
  max-width: 100%; max-height: 60vh; display: block; pointer-events: none;
}
.crop-box {
  position: absolute;
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  cursor: move;
}
.crop-handle {
  position: absolute; width: 12px; height: 12px;
  background: white; border: 2px solid var(--blue);
  border-radius: 2px;
}
.crop-handle.nw { top:-6px; left:-6px; cursor: nw-resize; }
.crop-handle.ne { top:-6px; right:-6px; cursor: ne-resize; }
.crop-handle.sw { bottom:-6px; left:-6px; cursor: sw-resize; }
.crop-handle.se { bottom:-6px; right:-6px; cursor: se-resize; }
.crop-handle.n  { top:-6px; left:50%; transform:translateX(-50%); cursor: n-resize; }
.crop-handle.s  { bottom:-6px; left:50%; transform:translateX(-50%); cursor: s-resize; }
.crop-handle.w  { left:-6px; top:50%; transform:translateY(-50%); cursor: w-resize; }
.crop-handle.e  { right:-6px; top:50%; transform:translateY(-50%); cursor: e-resize; }

.crop-info {
  font-size: 11px; color: var(--text2); text-align: center; margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}
.crop-presets {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.crop-preset {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 12px;
  font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text2);
  transition: all 0.15s;
}
.crop-preset:hover, .crop-preset.active { background: rgba(0,194,255,0.12); border-color: var(--border2); color: var(--blue); }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ─── IMAGE RESHAPER ─── */
.rsh-modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 22px; width: 94vw; max-width: 980px;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), var(--glow-blue);
}
.rsh-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.rsh-modal-header h2 { font-family:'Inter',sans-serif; font-size:18px; font-weight:800; display:flex; align-items:center; gap:8px; }
.rsh-modal-header .rsh-badge {
  font-size:9.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  padding:3px 9px; border-radius:20px; color:#1a1206;
  background: linear-gradient(135deg,#f7e29a,#c9962f 55%,#8a6100);
  box-shadow: 0 2px 8px rgba(201,150,47,0.4);
}
.rsh-body { display:flex; gap:20px; overflow:hidden; flex:1; min-height:0; }
.rsh-stage-col {
  flex:1.15; display:flex; align-items:center; justify-content:center; min-width:0;
  background:#0b0d12; border-radius:14px; padding:24px; position:relative; overflow:auto;
}
.rsh-stage-col::before {
  content:''; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(circle at 28% 18%, rgba(255,255,255,0.06), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 10px, transparent 10px 20px);
}
.rsh-stage { position:relative; display:inline-block; max-width:100%; }
.rsh-stage img#rshStageRef { max-width:100%; max-height:52vh; display:block; visibility:hidden; }
.rsh-stage svg {
  position:absolute; inset:0; width:100%; height:100%;
  filter: drop-shadow(0 14px 32px rgba(0,0,0,0.55));
}
.rsh-panel { flex:1; display:flex; flex-direction:column; gap:14px; overflow-y:auto; padding-right:4px; min-width:270px; max-width:340px; }
.rsh-section-label { font-size:10.5px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; color:var(--text3); margin-bottom:8px; }
.rsh-shape-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px 8px; padding-bottom:6px; }
.rsh-shape-swatch {
  aspect-ratio:1; background:var(--surface); border:1px solid var(--border); border-radius:12px;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition:all .15s; position:relative; padding:8px; margin-bottom:12px;
}
.rsh-shape-swatch svg { width:100%; height:100%; overflow:visible; }
.rsh-shape-swatch:hover { border-color:var(--border2); background:var(--surface2); transform:translateY(-2px); }
.rsh-shape-swatch.active { border-color:#c9962f; background:rgba(201,150,47,0.12); box-shadow:0 0 0 1px rgba(201,150,47,0.5), 0 6px 16px rgba(201,150,47,0.18); }
.rsh-shape-swatch path { fill: var(--text3); transition: fill .15s; }
.rsh-shape-swatch:hover path { fill: var(--text2); }
.rsh-shape-swatch.active path { fill:#c9962f; }
.rsh-shape-name {
  position:absolute; bottom:-13px; left:0; right:0; text-align:center;
  font-size:8px; font-weight:600; color:var(--text3); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;
}

/* ─── SHAPE STUDIO + MY SHAPES (custom Image Reshaper shapes) ─── */
.rsh-my-head { display:flex; align-items:center; justify-content:space-between; }
.rsh-create-tile { border-style:dashed !important; border-color:rgba(201,150,47,0.55) !important; color:#c9962f; }
.rsh-create-tile:hover { background:rgba(201,150,47,0.10) !important; border-color:#c9962f !important; }
.rsh-create-tile svg { width:46% !important; height:46% !important; }
.rsh-create-tile .rsh-shape-name { color:#c9962f; font-weight:800; }
.rsh-my-btn {
  position:absolute; top:-6px; width:20px; height:20px; border-radius:50%;
  border:1px solid var(--border2); background:var(--bg2); color:var(--text2);
  font-size:10px; line-height:1; cursor:pointer; display:none; align-items:center; justify-content:center; padding:0;
}
.rsh-shape-swatch:hover .rsh-my-btn { display:flex; }
.rsh-my-edit { right:16px; }
.rsh-my-del { right:-6px; }
.rsh-my-btn:hover { color:#c9962f; border-color:#c9962f; }
.rsh-my-btn.armed { width:auto; border-radius:10px; padding:0 6px; background:#c0392b; color:#fff; border-color:#c0392b; display:flex; right:-6px; }
@media (hover:none) { .rsh-my-btn { display:flex; } }
.cs-modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 22px; width: 96vw; max-width: 1040px;
  max-height: 94vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), var(--glow-blue);
}
.cs-body { display:flex; gap:20px; overflow:hidden; flex:1; min-height:0; }
.cs-stage-col {
  flex:1.25; display:flex; align-items:center; justify-content:center; min-width:0;
  background:#0b0d12; border-radius:14px; padding:18px; position:relative; overflow:auto;
}
.cs-stage { position:relative; display:inline-block; max-width:100%; user-select:none; -webkit-user-select:none; }
.cs-stage img#csStageRef { max-width:100%; max-height:56vh; min-width:260px; display:block; visibility:hidden; }
.cs-stage svg { position:absolute; inset:0; width:100%; height:100%; touch-action:none; cursor:crosshair; overflow:visible; }
.cs-stage svg g { pointer-events:none; }
.cs-tools { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.cs-tool {
  display:flex; flex-direction:column; align-items:center; gap:5px; padding:10px 6px;
  background:var(--surface); border:1px solid var(--border); border-radius:12px; cursor:pointer;
  color:var(--text2); font-size:10.5px; font-weight:700; font-family:inherit; transition:all .15s;
}
.cs-tool:hover { border-color:var(--border2); color:var(--text); }
.cs-tool.active { border-color:#c9962f; background:rgba(201,150,47,0.12); color:#c9962f; box-shadow:0 0 0 1px rgba(201,150,47,0.5); }
.cs-hint { font-size:11px; color:var(--text3); line-height:1.5; margin-top:8px; }
.cs-mini-row { display:flex; flex-wrap:wrap; gap:6px; }
.cs-mini {
  flex:1 1 auto; padding:8px 10px; font-size:11px; font-weight:700; font-family:inherit; cursor:pointer;
  background:var(--surface); border:1px solid var(--border); color:var(--text2); border-radius:9px; transition:all .15s; white-space:nowrap;
}
.cs-mini:hover:not(:disabled) { border-color:#c9962f; color:#c9962f; }
.cs-mini:disabled { opacity:.4; cursor:default; }
.cs-select, .cs-input {
  width:100%; padding:9px 11px; font-size:12px; font-family:inherit; color:var(--text);
  background:var(--surface); border:1px solid var(--border); border-radius:9px; margin-top:8px;
}
.cs-input { margin-top:0; }
.cs-range { width:100%; accent-color:#c9962f; }
@media (max-width: 760px) {
  .cs-body { flex-direction:column; overflow-y:auto; overflow-x:hidden; }
  .cs-stage-col { flex:0 0 auto; padding:12px; overflow:visible; }
  .cs-panel-col { flex:0 0 auto !important; max-width:none !important; min-width:0 !important; overflow:visible !important; padding-right:0 !important; }
  .cs-stage img#csStageRef { max-height:42vh; min-width:200px; }
}
.rsh-bevel-toggle {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px 14px; cursor:pointer;
  transition:border-color .15s;
}
.rsh-bevel-toggle:hover { border-color:var(--border2); }
.rsh-bevel-toggle-label { display:flex; flex-direction:column; gap:2px; }
.rsh-bevel-toggle-label b { font-size:12.5px; font-weight:700; color:var(--text); }
.rsh-bevel-toggle-label span { font-size:10.5px; color:var(--text3); }
.rsh-switch { width:38px; height:22px; border-radius:20px; background:var(--surface2); border:1px solid var(--border); position:relative; flex-shrink:0; transition:all .2s; }
.rsh-switch::after { content:''; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:var(--text3); transition:all .2s; }
.rsh-switch.on { background:linear-gradient(135deg,#e8c76b,#8a6100); border-color:#c9962f; }
.rsh-switch.on::after { left:18px; background:#1a1206; }
.rsh-bevel-styles { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.rsh-bevel-style { border-radius:12px; border:1px solid var(--border); padding:10px 6px 8px; cursor:pointer; text-align:center; transition:all .15s; }
.rsh-bevel-style:hover { border-color:var(--border2); }
.rsh-bevel-style.active { border-color:#c9962f; box-shadow:0 0 0 1px rgba(201,150,47,0.5); }
.rsh-bevel-swatch-dot { width:100%; height:22px; border-radius:8px; margin-bottom:6px; }
.rsh-bevel-style span { font-size:10px; font-weight:700; color:var(--text2); }
.rsh-bevel-swatch-dot.gold { background:linear-gradient(135deg,#fff6d8,#e8c76b 45%,#8a6100); }
.rsh-bevel-swatch-dot.silver { background:linear-gradient(135deg,#ffffff,#c7c7c7 45%,#5c5c5c); }
.rsh-bevel-swatch-dot.graphite { background:linear-gradient(135deg,#6b6b6b,#2a2a2a 45%,#000000); }
.rsh-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:16px; padding-top:14px; border-top:1px solid var(--border); flex-shrink:0; }
@media (max-width:760px) {
  .rsh-body { flex-direction:column; overflow-y:auto; }
  .rsh-panel { max-width:none; }
  .rsh-stage img#rshStageRef { max-height:34vh; }
}


/* ─── SIDEBAR FOLDER ─── */
.sidebar-folder-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 9px;
  cursor: pointer; color: var(--text2);
  font-size: 13px; font-weight: 500;
  transition: all 0.15s; user-select: none;
}
.sidebar-folder-header:hover { background: var(--surface2); color: var(--text); box-shadow: var(--shadow-nav); }
.sidebar-folder-header .folder-chevron {
  margin-left: auto; font-size: 10px; transition: transform 0.2s; color: var(--text3);
}
.sidebar-folder-header.open .folder-chevron { transform: rotate(90deg); }
.sidebar-folder-body {
  display: none; flex-direction: column; gap: 2px;
  padding: 4px 8px; max-height: 260px; overflow-y: auto;
}
.sidebar-folder-body.open { display: flex; }
.sidebar-thumb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 7px; cursor: pointer;
  transition: background 0.12s; position: relative;
}
.sidebar-thumb-item:hover { background: var(--surface2); }
.sidebar-thumb-item img {
  width: 32px; height: 32px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-thumb-name {
  font-size: 11px; color: var(--text2); overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; flex: 1;
}
.sidebar-thumb-actions {
  display: none; gap: 3px; align-items: center;
}
.sidebar-thumb-item:hover .sidebar-thumb-actions { display: flex; }
.sth-btn {
  width: 20px; height: 20px; border-radius: 4px;
  background: var(--surface2); border: none; cursor: pointer;
  color: var(--text2); font-size: 10px; display: flex;
  align-items: center; justify-content: center; transition: all 0.1s;
}
.sth-btn:hover { background: var(--blue); color: white; }
.sth-btn.del:hover { background: #ef4444; }
.sidebar-folder-empty { font-size: 11px; color: var(--text3); padding: 8px 8px 4px; }
#moreToolsBody .nav-item { border-bottom: 1px solid var(--border); margin: 0 4px; border-radius: 0; font-size: 12px; }
#moreToolsBody .nav-item:last-child { border-bottom: none; }
#moreToolsBody .nav-item .nav-icon svg { width: 14px; height: 14px; }
