/* ============================================================
   Short Tools — colourful, category-coded UI
   Each tool category gets its own gradient identity (a small
   monogram chip on the card + a matching header bar once a
   tool is open), so people can tell tool-families apart at a
   glance while the forms themselves stay clean and legible.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap');

.sht-root {
  --sht-primary:#3b6ef6;
  --sht-primary-2:#6f93ff;
  --sht-bg:#F5F4FA;
  --sht-card:#fff;
  --sht-border:#e6e4f0;
  --sht-text:#171522;
  --sht-muted:#6b6880;

  /* Category identities */
  --cat-image-1:#FF6B4A;   --cat-image-2:#FFB454;
  --cat-text-1:#7B5CFA;    --cat-text-2:#B79CFF;
  --cat-security-1:#05B889;--cat-security-2:#4CE0B3;
  --cat-generators-1:#F0429C; --cat-generators-2:#FF8FC7;
  --cat-developer-1:#2E6BFF;  --cat-developer-2:#63C7FF;
  --cat-design-1:#05AFC7;     --cat-design-2:#7BE8E0;
  --cat-calculators-1:#2A3142;--cat-calculators-2:#F5B301;

  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--sht-text);
}
.sht-root .sht-name,
.sht-root .sht-chip,
.sht-root .sht-panel-head h2,
.sht-root .sht-cat {
  font-family:"Sora","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,sans-serif;
}

/* ---------- grid ---------- */
.sht-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:18px; }

.sht-card {
  position:relative;
  overflow:hidden;
  background:var(--sht-card);
  border:1px solid var(--sht-border);
  border-radius:16px;
  padding:20px 18px 22px;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.sht-card { display:block; text-decoration:none; color:inherit; }

/* Coloured top edge, tinted per category */
.sht-card::after {
  content:"";
  position:absolute; top:0; left:0; right:0; height:4px;
  background:linear-gradient(90deg, var(--_c1), var(--_c2));
  opacity:.9;
}
.sht-card[data-sht-cat="Image"]       { --_c1:var(--cat-image-1);       --_c2:var(--cat-image-2); }
.sht-card[data-sht-cat="Text"]        { --_c1:var(--cat-text-1);        --_c2:var(--cat-text-2); }
.sht-card[data-sht-cat="Security"]    { --_c1:var(--cat-security-1);    --_c2:var(--cat-security-2); }
.sht-card[data-sht-cat="Generators"]  { --_c1:var(--cat-generators-1);  --_c2:var(--cat-generators-2); }
.sht-card[data-sht-cat="Developer"]   { --_c1:var(--cat-developer-1);   --_c2:var(--cat-developer-2); }
.sht-card[data-sht-cat="Design"]      { --_c1:var(--cat-design-1);      --_c2:var(--cat-design-2); }
.sht-card[data-sht-cat="Calculators"] { --_c1:var(--cat-calculators-1); --_c2:var(--cat-calculators-2); }

.sht-card:hover {
  transform:translateY(-3px);
  border-color:transparent;
  box-shadow:0 14px 30px -12px var(--_c1, rgba(59,110,246,.35));
}

/* Monogram chip */
.sht-chip {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:46px; height:26px; padding:0 9px;
  border-radius:8px;
  font-size:11px; font-weight:800; letter-spacing:.04em;
  color:#fff;
  background:linear-gradient(135deg, var(--_c1, var(--sht-primary)), var(--_c2, var(--sht-primary-2)));
}
.sht-card[data-sht-cat="Calculators"] .sht-chip { color:var(--cat-calculators-2); }

.sht-cat {
  display:inline-block; margin-left:8px;
  font-size:11px; font-weight:700;
  color:var(--_c1, var(--sht-muted));
  vertical-align:middle;
}
.sht-name { margin:14px 0 0; font-size:16px; font-weight:700; line-height:1.3; }

/* ---------- tool panel (opened view) ---------- */
.sht-tool-mount { margin-top:22px; }
.sht-root.sht-tool-active .sht-tool-mount { margin-top:0; }

.sht-panel {
  background:var(--sht-card);
  border:1px solid var(--sht-border);
  border-radius:18px;
  overflow:hidden;
}
.sht-panel-head {
  display:flex; align-items:center; justify-content:space-between;
  margin:0; padding:22px 24px;
  background:linear-gradient(120deg, var(--sht-primary), var(--sht-primary-2));
  color:#fff;
}
.sht-root[data-active-cat="Image"]       .sht-panel-head { background:linear-gradient(120deg, var(--cat-image-1), var(--cat-image-2)); }
.sht-root[data-active-cat="Text"]        .sht-panel-head { background:linear-gradient(120deg, var(--cat-text-1), var(--cat-text-2)); }
.sht-root[data-active-cat="Security"]    .sht-panel-head { background:linear-gradient(120deg, var(--cat-security-1), var(--cat-security-2)); }
.sht-root[data-active-cat="Generators"]  .sht-panel-head { background:linear-gradient(120deg, var(--cat-generators-1), var(--cat-generators-2)); }
.sht-root[data-active-cat="Developer"]   .sht-panel-head { background:linear-gradient(120deg, var(--cat-developer-1), var(--cat-developer-2)); }
.sht-root[data-active-cat="Design"]      .sht-panel-head { background:linear-gradient(120deg, var(--cat-design-1), var(--cat-design-2)); }
.sht-root[data-active-cat="Calculators"] .sht-panel-head { background:linear-gradient(120deg, var(--cat-calculators-1), var(--cat-calculators-2)); }

.sht-panel-head h2 { margin:0; font-size:20px; font-weight:800; letter-spacing:-.01em; }
.sht-back {
  border:1px solid rgba(255,255,255,.55);
  background:rgba(255,255,255,.14);
  color:#fff;
  padding:8px 14px; border-radius:9px; cursor:pointer; font-weight:700; font-size:13px;
  transition:background .15s ease;
}
.sht-back:hover { background:rgba(255,255,255,.28); }

.sht-panel > div:last-child { padding:22px 24px 26px; }

.sht-panel label { display:block; font-size:13px; font-weight:600; margin:12px 0 6px; color:var(--sht-text); }
.sht-panel input[type=text], .sht-panel input[type=number], .sht-panel textarea, .sht-panel select {
  width:100%; box-sizing:border-box; padding:11px 13px;
  border:1px solid var(--sht-border); border-radius:10px;
  font-size:14px; font-family:inherit; background:#fff;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.sht-panel input[type=text]:focus, .sht-panel input[type=number]:focus, .sht-panel textarea:focus, .sht-panel select:focus {
  outline:none; border-color:var(--sht-primary); box-shadow:0 0 0 3px rgba(59,110,246,.15);
}
.sht-panel textarea { min-height:120px; resize:vertical; }

.sht-btn {
  background:linear-gradient(120deg, var(--sht-primary), var(--sht-primary-2));
  color:#fff; border:none; padding:12px 20px; border-radius:10px;
  font-weight:700; cursor:pointer; font-size:14px; margin-top:16px;
  box-shadow:0 8px 18px -8px rgba(59,110,246,.55);
  transition:transform .12s ease, box-shadow .12s ease;
}
.sht-btn:hover { transform:translateY(-1px); }
.sht-root[data-active-cat="Image"]       .sht-btn { background:linear-gradient(120deg, var(--cat-image-1), var(--cat-image-2)); box-shadow:0 8px 18px -8px var(--cat-image-1); }
.sht-root[data-active-cat="Text"]        .sht-btn { background:linear-gradient(120deg, var(--cat-text-1), var(--cat-text-2)); box-shadow:0 8px 18px -8px var(--cat-text-1); }
.sht-root[data-active-cat="Security"]    .sht-btn { background:linear-gradient(120deg, var(--cat-security-1), var(--cat-security-2)); box-shadow:0 8px 18px -8px var(--cat-security-1); }
.sht-root[data-active-cat="Generators"]  .sht-btn { background:linear-gradient(120deg, var(--cat-generators-1), var(--cat-generators-2)); box-shadow:0 8px 18px -8px var(--cat-generators-1); }
.sht-root[data-active-cat="Developer"]   .sht-btn { background:linear-gradient(120deg, var(--cat-developer-1), var(--cat-developer-2)); box-shadow:0 8px 18px -8px var(--cat-developer-1); }
.sht-root[data-active-cat="Design"]      .sht-btn { background:linear-gradient(120deg, var(--cat-design-1), var(--cat-design-2)); box-shadow:0 8px 18px -8px var(--cat-design-1); }
.sht-root[data-active-cat="Calculators"] .sht-btn { background:linear-gradient(120deg, var(--cat-calculators-1), var(--cat-calculators-2)); box-shadow:0 8px 18px -8px var(--cat-calculators-1); color:#231a03; }

.sht-btn.sec { background:var(--sht-bg); color:var(--sht-text); box-shadow:none; }

.sht-row { display:flex; gap:10px; flex-wrap:wrap; }
.sht-row > * { flex:1; min-width:120px; }

.sht-drop {
  border:2px dashed var(--sht-border); border-radius:14px; padding:40px;
  text-align:center; cursor:pointer; color:var(--sht-muted); background:var(--sht-bg);
  transition:border-color .15s ease, background .15s ease;
}
.sht-drop:hover { border-color:var(--sht-primary); background:#eef2ff; }

.sht-preview { max-height:260px; max-width:100%; border-radius:10px; margin:12px auto; display:block; }
.sht-out { margin-top:14px; padding:12px; background:var(--sht-bg); border-radius:9px; font-family:monospace; font-size:13px; word-break:break-all; white-space:pre-wrap; }

.sht-stat { display:flex; gap:20px; flex-wrap:wrap; margin-top:8px; }
.sht-stat div { font-weight:800; font-size:22px; background:linear-gradient(120deg, var(--sht-primary), var(--sht-primary-2)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.sht-stat span { display:block; font-size:12px; font-weight:600; color:var(--sht-muted); }

.sht-error { color:#c0392b; padding:12px; }
.sht-hidden { display:none; }

/* ---------- color converter: SV square + hue slider + formats ---------- */
.sht-color-picker { --sht-color-preview:#3b6ef6; }

.sht-color-sv-wrap {
  position:relative; width:100%; max-width:340px; aspect-ratio:280/200;
  border-radius:12px; overflow:hidden; border:1px solid var(--sht-border);
  cursor:crosshair; touch-action:none;
}
.sht-color-sv { display:block; width:100%; height:100%; }
.sht-color-sv-handle {
  position:absolute; width:18px; height:18px; margin:-9px 0 0 -9px;
  border-radius:50%; border:2.5px solid #fff; box-shadow:0 0 0 1.5px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.35);
  pointer-events:none;
}

.sht-color-hue-wrap {
  position:relative; width:100%; max-width:340px; height:18px; margin-top:16px;
  border-radius:999px; cursor:pointer; touch-action:none;
  background:linear-gradient(90deg, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  border:1px solid var(--sht-border);
}
.sht-color-hue-handle {
  position:absolute; top:50%; width:22px; height:22px; margin:-11px 0 0 -11px;
  border-radius:50%; background:#fff; border:2.5px solid #fff;
  box-shadow:0 0 0 1.5px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.35);
  pointer-events:none;
}

.sht-color-formats-title { margin-top:22px; font-size:13px; font-weight:700; color:var(--sht-muted); text-transform:uppercase; letter-spacing:.04em; }
.sht-color-formats { margin-top:8px; display:flex; flex-direction:column; gap:8px; }
.sht-color-row {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--sht-bg); border:1px solid var(--sht-border); border-radius:10px; padding:10px 14px;
}
.sht-color-row-left { display:flex; flex-direction:column; gap:2px; min-width:0; }
.sht-color-row-label { font-size:11px; font-weight:700; color:var(--sht-muted); text-transform:uppercase; letter-spacing:.04em; }
.sht-color-row-value { font-family:monospace; font-size:14px; font-weight:600; word-break:break-all; }
.sht-color-copy { margin-top:0; padding:8px 14px; font-size:13px; flex-shrink:0; }
.sht-color-tw-note { font-size:12px; color:var(--sht-muted); margin:-4px 2px 0; }

.sht-hub-back {
  display:inline-flex; align-items:center; gap:6px;
  margin-bottom:16px; color:var(--sht-primary); font-weight:700; font-size:14px; text-decoration:none;
}
.sht-hub-back:hover { text-decoration:underline; }

@media (max-width:480px) {
  .sht-grid { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; }
  .sht-card { padding:16px 14px 18px; }
}
