/* Micro tool pages (views/micro/*) and the More tools menu. Uses the tokens
   from codegres-brand.css. */
.mt-page { padding: 28px 0 64px; color: var(--cg-text); background: var(--cg-light); }
.mt-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--cg-muted); margin-bottom: 14px; }
.mt-crumbs a { color: var(--cg-muted); }
.mt-crumbs a:hover { color: var(--cg-primary); }
.mt-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; margin: 0 0 10px; line-height: 1.15; }
.mt-lead { font-size: 1.1rem; color: var(--cg-muted); max-width: 820px; margin: 0 0 14px; }
.mt-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.mt-badges span {
  font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
  background: rgba(113, 20, 239, .08); color: var(--cg-primary);
}

/* Tool */
.mt-tool { margin-bottom: 40px; }
.mt-loading { padding: 40px; text-align: center; color: var(--cg-muted); }
.mt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mt-grid.mt-single { grid-template-columns: minmax(0, 1fr); }
.mt-panel, .mt-options {
  background: #fff; border: 1px solid var(--cg-border); border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 15, 53, .05); padding: 14px; min-width: 0;
}
.mt-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mt-panel h2, .mt-options h2 { font-size: 1rem !important; font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: .06em; color: var(--cg-navy); }
.mt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-actions button {
  border: 1px solid var(--cg-border) !important; background: #fff !important; color: var(--cg-navy) !important;
  border-radius: 10px !important; padding: 6px 12px !important; font-size: 14px !important; font-weight: 500;
  box-shadow: none !important; cursor: pointer; line-height: 1.3;
}
.mt-actions button:hover { border-color: var(--cg-primary) !important; color: var(--cg-primary) !important; }
.mt-actions button.mt-primary { background: var(--cg-gradient-accent) !important; color: #fff !important; border-color: transparent !important; }
.mt-actions button[hidden] { display: none; }
.mt-text {
  display: block; width: 100%; min-height: 320px; resize: vertical; border: 1px solid var(--cg-border);
  border-radius: 12px; padding: 12px; font: 14px/1.5 Consolas, "Cascadia Mono", Menlo, monospace !important;
  color: var(--cg-text); background: #fbfbfd; white-space: pre; overflow: auto; tab-size: 4;
}
.mt-text:focus { outline: 2px solid rgba(113, 20, 239, .35); border-color: var(--cg-primary); }
.mt-out-body { min-height: 320px; }
.mt-info { margin: 8px 0 0; font-size: 13px; color: var(--cg-muted); min-height: 1em; }
.mt-error { margin: 0; padding: 14px; border-radius: 12px; background: #fff3f0; color: #b42318; border: 1px solid #ffd2c8; white-space: pre-wrap; }
.mt-empty { margin: 0; padding: 120px 16px; text-align: center; color: var(--cg-muted); border: 2px dashed var(--cg-border); border-radius: 12px; }
.mt-html { min-height: 320px; padding: 8px; border: 1px solid var(--cg-border); border-radius: 12px; overflow: auto; max-height: 640px; }
.mt-html table { border-collapse: collapse; font-size: 14px; }
.mt-html td, .mt-html th { border: 1px solid var(--cg-border); padding: 4px 8px; }

/* Image in/out: checkerboard so transparency is visible */
.mt-drop, .mt-img {
  display: flex; align-items: center; justify-content: center; min-height: 320px; max-height: 560px;
  border-radius: 12px; overflow: auto; padding: 10px;
  background-color: #fff;
  background-image: linear-gradient(45deg, #eef0f5 25%, transparent 25%), linear-gradient(-45deg, #eef0f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef0f5 75%), linear-gradient(-45deg, transparent 75%, #eef0f5 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.mt-drop { border: 2px dashed #cfd4e2; cursor: pointer; }
.mt-drop:hover, .mt-drop.is-over, .mt-drop:focus { border-color: var(--cg-primary); outline: none; }
.mt-drop canvas, .mt-drop img, .mt-img img { max-width: 100%; max-height: 540px; height: auto; object-fit: contain; image-rendering: auto; }
.mt-drop-hint { text-align: center; color: var(--cg-muted); margin: 0; background: rgba(255, 255, 255, .9); padding: 10px 14px; border-radius: 10px; }

/* Options */
.mt-options { margin-top: 18px; }
.mt-options h2 { margin-bottom: 12px; }
.mt-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.mt-field { display: flex; flex-direction: column; gap: 4px; }
.mt-field label { font-size: 13px; font-weight: 600; color: var(--cg-navy); margin: 0; }
.mt-field input[type=text], .mt-field input[type=number], .mt-field select, .mt-field textarea {
  border: 1px solid var(--cg-border); border-radius: 10px; padding: 8px 10px; font-size: 14px; background: #fff; width: 100%;
}
.mt-field textarea { font-family: Consolas, Menlo, monospace !important; resize: vertical; }
.mt-field input[type=color] { width: 56px; height: 36px; border: 1px solid var(--cg-border); border-radius: 8px; padding: 2px; background: #fff; }
.mt-field.mt-check { flex-direction: row; align-items: center; gap: 8px; }
.mt-field.mt-check input { width: 18px; height: 18px; accent-color: var(--cg-primary); }
.mt-field.mt-check label { font-weight: 500; }

/* About, FAQ, related */
.mt-about { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 30px; }
.mt-about section { background: #fff; border: 1px solid var(--cg-border); border-radius: 16px; padding: 20px; }
.mt-about h2, .mt-related h2 { font-size: 1.2rem !important; font-weight: 700; margin: 0 0 12px; }
.mt-about ol { padding-left: 20px; margin: 0; }
.mt-about li { margin-bottom: 6px; line-height: 1.55; }
.mt-about p { margin: 0; line-height: 1.6; color: var(--cg-muted); }
.mt-faq details { border-top: 1px solid var(--cg-border); padding: 8px 0; }
.mt-faq details:first-of-type { border-top: 0; }
.mt-faq summary { cursor: pointer; font-weight: 600; color: var(--cg-navy); }
.mt-faq details p { margin-top: 6px; font-size: 14px; }
.mt-related ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 12px; }
.mt-related li a {
  display: inline-block; padding: 7px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--cg-border);
  color: var(--cg-navy); font-size: 14px; text-decoration: none;
}
.mt-related li a:hover { border-color: var(--cg-primary); color: var(--cg-primary); }
.mt-more { font-weight: 600; }

/* Section index */
.mt-filter { display: block; max-width: 460px; margin: 6px 0 26px; }
.mt-filter input { width: 100%; padding: 12px 18px; border-radius: 30px; border: 1px solid var(--cg-border); font-size: 16px; box-shadow: 0 6px 18px rgba(15, 15, 53, .05); }
.mt-group { margin-bottom: 30px; }
.mt-group h2 { font-size: 1.35rem !important; font-weight: 700; margin: 0 0 14px; }
.mt-group h2 small { font-size: 14px; color: var(--cg-muted); font-weight: 500; margin-left: 6px; }
.mt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mt-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: #fff; border: 1px solid var(--cg-border);
  border-radius: 14px; color: var(--cg-text) !important; text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.mt-card:hover { transform: translateY(-2px); border-color: rgba(113, 20, 239, .35); box-shadow: 0 10px 24px rgba(113, 20, 239, .1); }
.mt-card strong { color: var(--cg-navy); font-size: 15px; }
.mt-card span { color: var(--cg-muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-card[hidden], .mt-group[hidden] { display: none; }

/* More tools menu in the header: opens on hover/focus, links to /tools without JS */
.cg-more { position: relative; }
.cg-more-menu {
  display: none; position: absolute; right: 0; top: 100%; z-index: 1000; min-width: 230px; padding: 8px;
  background: #fff; border: 1px solid var(--cg-border); border-radius: 14px; box-shadow: 0 18px 40px rgba(15, 15, 53, .12);
}
.cg-more:hover .cg-more-menu, .cg-more:focus-within .cg-more-menu { display: block; }
.cg-more-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--cg-navy); font-size: 15px; text-decoration: none; }
.cg-more-menu a:hover { background: var(--cg-light); color: var(--cg-primary); }
@media (max-width: 991px) {
  .cg-more-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; display: block; }
}

@media (max-width: 900px) {
  .mt-grid { grid-template-columns: minmax(0, 1fr); }
  .mt-about { grid-template-columns: minmax(0, 1fr); }
  .mt-text, .mt-out-body, .mt-drop, .mt-img { min-height: 220px; }
  .mt-empty { padding: 80px 16px; }
}

/* Search palette badges for the micro tool sections */
.cgs-badge-text, .cgs-badge-string, .cgs-badge-json, .cgs-badge-csv, .cgs-badge-dev,
.cgs-badge-number, .cgs-badge-random, .cgs-badge-time { background: rgba(8, 160, 200, .1); color: #0A6F8C; }
