/* ============================================================
   COMMON STYLES — shared across all tool pages
   ============================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === BASE === */
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0d0d0d;
  color: #e8e8e8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === NAV === */
nav {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  gap: 0;
  position: sticky;
  top: 0;
  background: #0d0d0d;
  z-index: 50;
}
.nav-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.nav-center {
  flex: 0 0 auto;
}
.nav-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-left: 1px solid #1e1e1e;
  margin-left: 1.5rem;
  padding-left: 1.5rem;
}
nav a { color: #666; text-decoration: none; font-size: 0.875rem; }
nav a:hover { color: #aaa; }
nav .sep { color: #333; }
nav .current { color: #e8e8e8; font-weight: 500; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === NAV GAMEBAR === */
.nav-gamebar {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.nav-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 0.3rem 0.75rem;
  color: #bbb;
  cursor: default;
  transition: border-color 0.2s;
}
.nav-stat:hover { border-color: #444; }
.nav-stat-icon { font-size: 0.85rem; line-height: 1; }
.nav-stat-lbl { color: #555; font-size: 0.72rem; }
.pts-stat { color: #facc15; justify-content: center; }
.pts-stat .nav-stat-lbl { color: #7a6318; }
.disc-stat { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.2rem; }
.disc-top { display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.nav-disc-bar-wrap {
  width: 100%;
  height: 5px;
  background: #2a2a2a;
  border-radius: 99px;
  overflow: hidden;
}
.nav-disc-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  border-radius: 99px;
  width: 0%;
  transition: width 0.5s ease;
}
.nav-level {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #55555550;
  color: #555;
  white-space: nowrap;
  transition: color 0.4s, border-color 0.4s;
  display: flex;
  align-items: center;
}
@keyframes stat-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.stat-pop { animation: stat-pop 0.35s ease; }

/* === SEARCH === */
.search-wrap {
  position: relative;
}
.search-input {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #e8e8e8;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem 0.4rem 2rem;
  outline: none;
  width: 180px;
  transition: border-color 0.2s, width 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.5rem center;
}
.search-input:focus {
  border-color: #22c55e;
  width: 240px;
}
.search-input::placeholder { color: #444; }
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  display: none;
  z-index: 200;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.875rem;
  text-decoration: none;
  border-bottom: 1px solid #222;
  transition: background 0.1s;
  gap: 0.75rem;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.active { background: #222; }
.search-result-name { font-size: 0.825rem; color: #e8e8e8; flex: 1; }
.search-result-cat {
  font-size: 0.65rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #242424;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.search-no-results { padding: 0.75rem 0.875rem; font-size: 0.8rem; color: #555; }

/* === HERO === */
.hero {
  padding: 2.5rem 2rem 1.5rem;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}
.hero h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
.hero p { margin-top: 0.5rem; color: #888; font-size: 0.9rem; line-height: 1.6; }
.hero p a { color: #22c55e; text-decoration: none; }
.hero p a:hover { text-decoration: underline; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: #111a11;
  border: 1px solid #1a4a1a;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #5faf5f;
  font-family: monospace;
}
.model-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: #14120a;
  border: 1px solid #4a3e10;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #d4b84a;
  font-family: monospace;
}

/* === CONTAINER === */
.container {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === CARD === */
.card {
  background: #161616;
  border: 1px solid #242424;
  border-radius: 12px;
  padding: 1.5rem;
}

/* === FORM ELEMENTS === */
label { font-size: 0.8rem; color: #888; display: block; margin-bottom: 0.4rem; }

textarea,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"] {
  width: 100%;
  background: #1e1e1e;
  color: #e8e8e8;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: monospace;
  outline: none;
}
textarea { resize: vertical; line-height: 1.5; }
textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus { border-color: #22c55e; }

select {
  background: #1e1e1e;
  color: #e8e8e8;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
}
select:focus { border-color: #22c55e; }

input[type="range"] { accent-color: #22c55e; cursor: pointer; }
input[type="checkbox"] { accent-color: #22c55e; width: 1rem; height: 1rem; cursor: pointer; }

/* === BUTTONS === */
.btn {
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #22c55e;
  color: #0d0d0d;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover:not(:disabled) { background: #16a34a; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  background: #1e1e1e;
  color: #ccc;
  font-size: 0.8rem;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-ghost:hover { background: #252525; color: #e8e8e8; }

/* === UTILITIES === */
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.check-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #ccc; cursor: pointer; }
.copy-msg { font-size: 0.8rem; color: #22c55e; opacity: 0; transition: opacity 0.3s; }

/* === SEO SECTIONS === */
.seo-section { margin-top: 1rem; display: flex; flex-direction: column; gap: 1.25rem; }
.seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 700px) { .seo-grid { grid-template-columns: 1fr; } }
.seo-block { background: #161616; border: 1px solid #1e1e1e; border-radius: 12px; padding: 1.5rem; }
.seo-block h2 { font-size: 1rem; font-weight: 600; color: #e8e8e8; margin-bottom: 1rem; }
.seo-block ol, .seo-block ul { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.seo-block li { font-size: 0.875rem; color: #999; line-height: 1.5; }
.seo-block details { border-bottom: 1px solid #1e1e1e; padding: 0.75rem 0; }
.seo-block details:last-child { border-bottom: none; }
.seo-block summary { font-size: 0.875rem; color: #ccc; cursor: pointer; list-style: none; padding-right: 1.5rem; position: relative; }
.seo-block summary::-webkit-details-marker { display: none; }
.seo-block summary::after { content: '+'; position: absolute; right: 0; color: #555; }
.seo-block details[open] summary::after { content: '−'; }
.seo-block details p { font-size: 0.85rem; color: #888; line-height: 1.6; margin-top: 0.6rem; }

/* === RELATED TOOLS === */
.related-section { }
.related-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #444;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.related-card {
  background: #161616;
  border: 1px solid #242424;
  border-radius: 10px;
  padding: 1rem 1.125rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: border-color 0.15s, transform 0.15s;
}
.related-card:hover { border-color: #383838; transform: translateY(-1px); }
.related-name { font-size: 0.875rem; font-weight: 600; color: #e8e8e8; }
.related-cat { font-size: 0.65rem; color: #555; text-transform: uppercase; letter-spacing: 0.06em; }
.related-desc { font-size: 0.78rem; color: #666; line-height: 1.4; }

/* ============================================================
   TOOL COMPONENTS
   ============================================================ */

/* --- Stats grids --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; }
.stat { background: #161616; border: 1px solid #242424; border-radius: 10px; padding: 0.875rem 1rem; }
.stat-label { font-size: 0.72rem; color: #555; margin-bottom: 0.3rem; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: #e8e8e8; font-variant-numeric: tabular-nums; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.stat-card { background: #161616; border: 1px solid #242424; border-radius: 10px; padding: 0.875rem 1rem; }
.stat-row { display: flex; gap: 1rem; align-items: center; font-size: 0.8rem; color: #666; flex-wrap: wrap; }
.green { color: #22c55e !important; }
.saving { color: #22c55e; font-weight: 600; }

/* --- Big count (character counter) --- */
.big-count { text-align: center; padding: 1.25rem 0 0.5rem; }
.big-number { font-size: 3.5rem; font-weight: 700; color: #e8e8e8; line-height: 1; font-variant-numeric: tabular-nums; }
.big-label { font-size: 0.875rem; color: #666; margin-top: 0.4rem; }

/* --- Platform limits --- */
.limits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; }
.limit-card { background: #161616; border: 1px solid #242424; border-radius: 10px; padding: 0.875rem 1rem; }
.limit-name { font-size: 0.8rem; color: #aaa; margin-bottom: 0.5rem; }
.limit-bar-wrap { background: #242424; border-radius: 4px; height: 4px; overflow: hidden; margin-bottom: 0.4rem; }
.limit-bar { height: 100%; background: #22c55e; border-radius: 4px; transition: width 0.2s, background 0.2s; width: 0%; }
.limit-bar.warn { background: #eab308; }
.limit-bar.over { background: #ef4444; }
.limit-text { font-size: 0.75rem; color: #555; font-variant-numeric: tabular-nums; }

/* --- Dropzone --- */
.dropzone { border: 2px dashed #2a2a2a; border-radius: 12px; padding: 3rem 2rem; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.dropzone:hover, .dropzone.dragover { border-color: #22c55e; background: #0a150c; }
.dropzone input[type="file"] { display: none; }
.dropzone h3 { font-size: 1rem; font-weight: 600; margin: 0.5rem 0 0.25rem; color: #e8e8e8; }
.dropzone p { font-size: 0.8rem; color: #555; }
.dropzone-icon { font-size: 2.5rem; line-height: 1; margin-bottom: 0.25rem; }

/* --- File drop (inline) --- */
.file-drop { border: 1px dashed #2a2a2a; border-radius: 10px; padding: 0.875rem 1.25rem; text-align: center; font-size: 0.8rem; color: #555; cursor: pointer; transition: border-color 0.2s; }
.file-drop:hover { border-color: #444; color: #888; }
.file-drop input[type="file"] { display: none; }

/* --- Status bar (AI tools) --- */
.status-bar { display: flex; align-items: center; gap: 0.75rem; background: #161616; border: 1px solid #242424; border-radius: 10px; padding: 0.75rem 1rem; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #333; transition: background 0.3s; }
.status-indicator.ready { background: #22c55e; }
.status-indicator.loading { background: #eab308; animation: blink 1s ease-in-out infinite; }
.status-indicator.error { background: #ef4444; }
.status-text { font-size: 0.8rem; color: #888; flex: 1; line-height: 1.4; }
.status-text strong { color: #e8e8e8; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* --- Progress bar --- */
.progress-wrap { background: #242424; border-radius: 4px; height: 4px; overflow: hidden; margin-top: 0.5rem; }
.progress-bar { height: 100%; background: #22c55e; border-radius: 4px; transition: width 0.3s; width: 0%; }

/* --- Spinner --- */
.spinner { width: 28px; height: 28px; border: 3px solid #242424; border-top-color: #22c55e; border-radius: 50%; animation: spin 0.7s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Controls card --- */
.controls-card { background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.ctrl-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 130px; flex: 1; }
.ctrl-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; width: 100%; }
.range-wrap { display: flex; align-items: center; gap: 0.5rem; }
.range-wrap input[type="range"] { flex: 1; }
.lbl { font-size: 0.8rem; color: #888; display: block; margin-bottom: 0.4rem; }

/* --- Controls bar (uuid, lorem-ipsum) --- */
.controls { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 1.25rem; }
.ctrl { display: flex; flex-direction: column; gap: 0.4rem; min-width: 110px; }
.actions-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.action-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* --- Image comparison --- */
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .comparison { grid-template-columns: 1fr; } }
.img-card { background: #161616; border: 1px solid #242424; border-radius: 12px; overflow: hidden; }
.img-card-header { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 1rem; border-bottom: 1px solid #1e1e1e; font-size: 0.8rem; color: #888; }
.img-card-body { padding: 1rem; display: flex; align-items: center; justify-content: center; min-height: 180px; }
.img-card-body img { max-width: 100%; max-height: 380px; border-radius: 6px; }
.size-badge { font-size: 0.7rem; color: #666; background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 4px; padding: 0.15rem 0.4rem; font-variant-numeric: tabular-nums; }

/* --- Extra buttons --- */
.btn-dl { padding: 0.3rem 0.75rem; border-radius: 6px; border: 1px solid #1a4a1a; cursor: pointer; background: #0a150c; color: #22c55e; font-size: 0.75rem; font-family: inherit; transition: background 0.15s; }
.btn-dl:hover:not(:disabled) { background: #0d1f10; }
.btn-dl:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-sm { padding: 0.35rem 0.875rem; border-radius: 6px; border: 1px solid #2a2a2a; cursor: pointer; background: #1e1e1e; color: #ccc; font-size: 0.75rem; white-space: nowrap; font-family: inherit; transition: background 0.15s; }
.btn-sm:hover { background: #252525; }
.compress-btn, .resize-btn, .detect-btn, .scan-btn, .run-btn, .transcribe-btn, .convert-btn, .speak-btn { padding: 0.6rem 1.5rem; border-radius: 8px; border: none; cursor: pointer; background: #22c55e; color: #0d0d0d; font-weight: 600; font-size: 0.875rem; transition: background 0.2s; white-space: nowrap; font-family: inherit; }
.compress-btn:hover:not(:disabled), .resize-btn:hover:not(:disabled), .detect-btn:hover:not(:disabled), .scan-btn:hover:not(:disabled), .run-btn:hover:not(:disabled), .transcribe-btn:hover:not(:disabled), .convert-btn:hover:not(:disabled), .speak-btn:hover:not(:disabled) { background: #16a34a; }
.compress-btn:disabled, .resize-btn:disabled, .detect-btn:disabled, .scan-btn:disabled, .run-btn:disabled, .transcribe-btn:disabled, .convert-btn:disabled, .speak-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.copy-btn { padding: 0.3rem 0.75rem; border-radius: 6px; border: 1px solid #2a2a2a; cursor: pointer; background: #1e1e1e; color: #aaa; font-size: 0.75rem; font-family: monospace; transition: background 0.15s; }
.copy-btn:hover { background: #252525; color: #e8e8e8; }
.copy-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* --- Case converter buttons --- */
.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 0.5rem; }
.case-btn { background: #161616; border: 1px solid #2a2a2a; border-radius: 8px; padding: 0.6rem 0.875rem; color: #aaa; font-family: monospace; font-size: 0.875rem; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 0.2rem; transition: border-color 0.15s, background 0.15s; }
.case-btn:hover { border-color: #22c55e; background: #0a150c; color: #e8e8e8; }
.case-btn .label { font-size: 0.65rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; font-family: system-ui, sans-serif; }

/* --- IO grid (base64, url encode/decode) --- */
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .io-grid { grid-template-columns: 1fr; } }
.panel { display: flex; flex-direction: column; gap: 0.75rem; }
.panel-label { font-size: 0.7rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; }
.mode-row { display: flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid #2a2a2a; width: fit-content; }
.mode-btn { padding: 0.4rem 1rem; border: none; background: transparent; color: #666; font-size: 0.8rem; cursor: pointer; font-family: inherit; transition: background 0.15s, color 0.15s; }
.mode-btn.active { background: #1e1e1e; color: #e8e8e8; }
.mode-btn:hover:not(.active) { color: #aaa; }

/* --- Output card --- */
.output-card { background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.output-text { font-size: 0.875rem; color: #aaa; line-height: 1.7; white-space: pre-wrap; min-height: 4rem; }

/* --- Hash list --- */
.hash-list { display: flex; flex-direction: column; gap: 0.5rem; }
.hash-row { background: #161616; border: 1px solid #242424; border-radius: 8px; padding: 0.75rem 1rem; display: flex; gap: 0.875rem; align-items: baseline; flex-wrap: wrap; }
.hash-name { font-size: 0.7rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; min-width: 48px; flex-shrink: 0; }
.hash-value { font-family: monospace; font-size: 0.8rem; color: #22c55e; word-break: break-all; flex: 1; }

/* --- UUID list --- */
.uuid-list { display: flex; flex-direction: column; gap: 0.35rem; font-family: monospace; font-size: 0.875rem; }

/* --- Color tools --- */
.input-card { background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 1.25rem; display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.color-preview { width: 72px; height: 72px; border-radius: 10px; border: 1px solid #2a2a2a; overflow: hidden; flex-shrink: 0; }
.color-preview input[type="color"] { width: 100%; height: 100%; border: none; padding: 0; cursor: pointer; background: none; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 0.75rem; }
.result-item { background: #161616; border: 1px solid #242424; border-radius: 10px; padding: 0.875rem 1rem; }
.result-label { font-size: 0.7rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.result-value { font-family: monospace; font-size: 1rem; color: #e8e8e8; word-break: break-all; cursor: pointer; }
.swatch-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.meta-chip { display: inline-flex; align-items: center; gap: 0.3rem; background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 4px; padding: 0.15rem 0.5rem; font-size: 0.7rem; color: #888; cursor: pointer; transition: border-color 0.15s; }
.meta-chip:hover { border-color: #444; }

/* --- Unit toggle & input unit --- */
.unit-toggle { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid #2a2a2a; width: fit-content; }
.unit-btn { padding: 0.4rem 1rem; border: none; background: transparent; color: #666; font-size: 0.8rem; cursor: pointer; font-family: inherit; transition: background 0.15s, color 0.15s; }
.unit-btn.active { background: #1e1e1e; color: #e8e8e8; }
.unit-btn:hover:not(.active) { color: #aaa; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.input-unit { display: flex; align-items: stretch; }
.input-unit input { border-radius: 8px 0 0 8px !important; flex: 1; }
.unit-suffix { background: #1a1a1a; border: 1px solid #2a2a2a; border-left: none; border-radius: 0 8px 8px 0; padding: 0 0.75rem; font-size: 0.8rem; color: #555; display: flex; align-items: center; white-space: nowrap; }

/* --- BMI display --- */
.bmi-display { text-align: center; padding: 1.5rem 1rem 0.75rem; }
.bmi-number { font-size: 3rem; font-weight: 700; color: #e8e8e8; line-height: 1; font-variant-numeric: tabular-nums; }
.bmi-badge { display: inline-block; margin: 0.5rem 0; padding: 0.25rem 0.875rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #1e1e1e; color: #888; }
.bmi-scale { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(to right, #3b82f6 0%, #22c55e 35%, #eab308 65%, #ef4444 100%); margin: 1.25rem 0 0.5rem; }
.bmi-marker { position: absolute; top: -4px; width: 16px; height: 16px; background: #fff; border-radius: 50%; border: 2px solid #0d0d0d; transform: translateX(-50%); transition: left 0.3s; }

/* --- Password generator --- */
.main-card { background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.password-display { font-family: monospace; font-size: 1rem; color: #22c55e; background: #0d0d0d; border: 1px solid #2a2a2a; border-radius: 8px; padding: 0.875rem 1rem; min-height: 3.25rem; word-break: break-all; cursor: pointer; user-select: all; line-height: 1.6; }
.strength-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.strength-label { font-size: 0.75rem; color: #555; flex-shrink: 0; }
.strength-bar-wrap { flex: 1; background: #2a2a2a; border-radius: 4px; height: 5px; overflow: hidden; min-width: 80px; }
.strength-bar { height: 100%; border-radius: 4px; transition: width 0.3s, background 0.3s; }
.strength-text { font-size: 0.75rem; color: #888; }
.entropy-text { font-size: 0.7rem; color: #555; }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }
@media (max-width: 600px) { .controls-grid { grid-template-columns: 1fr; } }
.length-row { display: flex; align-items: center; gap: 0.5rem; }
.length-row input[type="range"] { flex: 1; }
.custom-chars { font-family: monospace; }

/* --- Slug generator --- */
.options-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-start; }
.opt-group { display: flex; flex-direction: column; gap: 0.4rem; }
.slug-output { font-family: monospace; font-size: 0.95rem; color: #22c55e; background: #0d0d0d; border: 1px solid #2a2a2a; border-radius: 8px; padding: 0.875rem 1rem; word-break: break-all; min-height: 2.5rem; user-select: all; }

/* --- Timestamp converter --- */
.now-card { background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 1.25rem; display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.now-label { font-size: 0.7rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.25rem; }
.now-value { font-family: monospace; font-size: 1.1rem; color: #e8e8e8; font-variant-numeric: tabular-nums; }
.field-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.field-row .field { min-width: 160px; }
.result-grid { display: flex; flex-direction: column; margin-top: 0.5rem; }
.result-rows { display: flex; flex-direction: column; }
.result-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #1a1a1a; font-size: 0.875rem; }
.result-row:last-child { border-bottom: none; }
.row-label { color: #555; }
.row-value { font-family: monospace; color: #e8e8e8; font-variant-numeric: tabular-nums; }
.error { color: #ef4444; font-size: 0.8rem; margin-top: 0.4rem; min-height: 1.2em; }

/* --- Percentage calculator --- */
.calc-card { background: #161616; border: 1px solid #242424; border-radius: 12px; padding: 1.25rem; }
.calc-title { font-size: 0.75rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.875rem; }
.eq-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.eq-row input { width: 90px; flex-shrink: 0; }
.eq-text { font-size: 0.875rem; color: #555; white-space: nowrap; }
.result-box { font-family: monospace; font-size: 1.1rem; font-weight: 600; color: #22c55e; min-width: 80px; padding: 0.5rem 0.75rem; background: #0a150c; border: 1px solid #1a4a1a; border-radius: 6px; text-align: center; font-variant-numeric: tabular-nums; }

/* --- Tip calculator --- */
.input-prefix { display: flex; align-items: stretch; }
.input-prefix input { border-radius: 0 8px 8px 0 !important; flex: 1; }
.prefix-symbol { background: #1a1a1a; border: 1px solid #2a2a2a; border-right: none; border-radius: 8px 0 0 8px; padding: 0 0.75rem; font-size: 0.875rem; color: #555; display: flex; align-items: center; }
.tip-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.tip-btn { padding: 0.4rem 0.875rem; border-radius: 6px; border: 1px solid #2a2a2a; background: #1e1e1e; color: #aaa; font-size: 0.8rem; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.tip-btn:hover, .tip-btn.active { border-color: #22c55e; background: #0a150c; color: #22c55e; }
.custom-tip { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.custom-tip input { width: 80px; }
.stepper { display: flex; align-items: center; gap: 0.75rem; }
.step-btn { width: 32px; height: 32px; border-radius: 6px; border: 1px solid #2a2a2a; background: #1e1e1e; color: #e8e8e8; font-size: 1.1rem; cursor: pointer; font-family: inherit; transition: background 0.15s; line-height: 1; display: flex; align-items: center; justify-content: center; }
.step-btn:hover { background: #252525; }
.people-val { font-size: 1.25rem; font-weight: 600; color: #e8e8e8; min-width: 2rem; text-align: center; font-variant-numeric: tabular-nums; }
.result-section { display: flex; flex-direction: column; gap: 0.5rem; }
.result-card { background: #0a150c; border: 1px solid #1a4a1a; border-radius: 10px; padding: 1rem 1.25rem; }
.result-header { font-size: 0.72rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }

/* --- Binary / base converter --- */
.converters { display: flex; flex-direction: column; gap: 0.75rem; }
.base-row { display: flex; align-items: center; gap: 0.75rem; background: #161616; border: 1px solid #242424; border-radius: 10px; padding: 0.875rem 1rem; }
.base-label { min-width: 130px; flex-shrink: 0; }
.base-name { font-size: 0.875rem; font-weight: 600; color: #e8e8e8; }
.base-desc { font-size: 0.7rem; color: #555; margin-top: 0.15rem; }
.base-prefix { font-family: monospace; font-size: 0.72rem; color: #444; margin-top: 0.15rem; }
.base-row input { flex: 1; }

/* --- Resize image --- */
.lock-btn { padding: 0.5rem 0.625rem; border-radius: 6px; border: 1px solid #2a2a2a; background: #1e1e1e; color: #555; font-size: 0.875rem; cursor: pointer; font-family: inherit; transition: all 0.15s; line-height: 1; }
.lock-btn.locked { border-color: #22c55e33; color: #22c55e; background: #0a150c; }
.preset-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.preset-btn { padding: 0.3rem 0.625rem; border-radius: 5px; border: 1px solid #2a2a2a; background: #1a1a1a; color: #666; font-size: 0.72rem; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.preset-btn:hover { border-color: #444; color: #aaa; }

/* --- Misc shared --- */
.note, .note-box { font-size: 0.8rem; color: #666; background: #161616; border: 1px solid #242424; border-radius: 8px; padding: 0.75rem 1rem; line-height: 1.5; }
.placeholder-text { color: #444; font-size: 0.875rem; padding: 2rem; text-align: center; }
.disclaimer { font-size: 0.75rem; color: #444; line-height: 1.5; }
.result-placeholder { color: #444; font-size: 0.875rem; padding: 1.5rem; text-align: center; }

/* ============================================================ */

/* === FOOTER === */
footer {
  text-align: center;
  padding: 2rem;
  color: #333;
  font-size: 0.8rem;
  border-top: 1px solid #1a1a1a;
}
footer a { color: #444; text-decoration: none; }
footer a:hover { color: #888; }
