/* =============================================================
   TOOLS PAGES  —  shared styles for all individual tool pages
   and the tools hub (tools.html).
   Hero styles live in components.css (.page-hero).
   ============================================================= */


/* ── Page shell ──────────────────────────────────────────── */
.tools-page { padding: 0 0 5rem; background: var(--bg); }


/* ── Microsoft product icon images ───────────────────────── */
.tool-hub-icon img,
.tool-card-icon img {
  width: 100%; height: 100%;
  border-radius: inherit;
  display: block;
  object-fit: cover;
}

/* remove emoji-only background when real icon is present */
.tool-hub-icon:has(img)  { background: transparent; font-size: 0; }
.tool-card-icon:has(img) { background: transparent; font-size: 0; }

.page-hero-badge img {
  width: 20px; height: 20px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 0.1rem;
  display: inline-block;
}

.more-tools-icon {
  width: 18px; height: 18px;
  border-radius: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  display: inline-block;
}


/* ── Individual tool page wrap ───────────────────────────── */
.tools-wrap {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}


/* ── Tool hub wrap & grid (tools.html) ───────────────────── */
.tools-hub-wrap {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.tool-hub-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color var(--transition-fast), transform var(--transition-mid);
}
.tool-hub-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.tool-hub-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-lo);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
}
.tool-hub-name { font-size: 0.97rem; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.tool-hub-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.55; flex: 1; }
.tool-hub-link {
  font-size: 0.76rem; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 0.3rem;
  margin-top: auto;
}


/* ── Tool card (individual pages) ────────────────────────── */
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tool-card-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-lo) 0%, transparent 100%);
}

.tool-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}

.tool-card-meta { flex: 1; }
.tool-card-name { font-size: 1.1rem; font-weight: 800; color: var(--text); letter-spacing: -0.4px; }
.tool-card-desc { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.5; }

.tool-free-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--green-lo);
  border: 1px solid rgba(22,163,74,.35);
  color: var(--green);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.4px;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.tool-card-body { padding: 1.4rem; }
.tool-divider   { height: 1px; background: var(--border); margin: 1.2rem 0; }


/* ── Calculator inputs ───────────────────────────────────── */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-field { display: flex; flex-direction: column; gap: 0.35rem; }

.calc-label {
  font-size: 0.76rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 0.4rem;
}
.calc-hint { font-size: 0.7rem; color: var(--muted); font-weight: 400; }

.calc-input,
.calc-select {
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem; color: var(--text);
  background: var(--bg);
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition-fast);
}
.calc-input:focus,
.calc-select:focus { outline: none; border-color: var(--accent); }

.calc-result {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  background: var(--accent-lo);
  border: 1.5px solid var(--accent-mid);
  border-radius: var(--radius-md);
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
}
.calc-result-item  { display: flex; flex-direction: column; gap: 0.15rem; }
.calc-result-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted2);
}
.calc-result-value { font-size: 1.3rem; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.calc-result-note  { font-size: 0.75rem; color: var(--muted); flex: 1; min-width: 180px; line-height: 1.5; }


/* ── Back link ───────────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.back-link:hover { color: var(--accent); }


/* ── More tools cross-link bar ───────────────────────────── */
.more-tools-bar {
  max-width: 800px; margin: 1.5rem auto 0; padding: 0 1.25rem;
  display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap;
}
.more-tools-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted2); white-space: nowrap; flex-shrink: 0;
}
.more-tools-links { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 1; }
.more-tools-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.8rem; color: var(--muted); text-decoration: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 0.25rem 0.75rem;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.more-tools-link:hover { border-color: var(--accent); color: var(--accent); }
.more-tools-name { font-weight: 600; color: var(--text); }
.more-tools-hint { color: var(--muted2); font-size: 0.75rem; }
.more-tools-all {
  font-size: 0.78rem; font-weight: 600; color: var(--accent);
  text-decoration: none; margin-left: auto; white-space: nowrap;
}
.more-tools-all:hover { text-decoration: underline; }
@media (max-width: 600px) { .more-tools-hint { display: none; } }


/* ── Result status variants ──────────────────────────────── */
.calc-result--ok {
  background: var(--success-lo);
  border-color: rgba(16,124,16,.25);
}
.calc-result--ok .calc-result-value { color: var(--success); }

.calc-result--warn {
  background: var(--amber-lo);
  border-color: rgba(217,119,6,.25);
}
.calc-result--warn .calc-result-value { color: var(--amber); }

.calc-result--danger {
  background: rgba(225,29,72,.08);
  border-color: rgba(225,29,72,.25);
}
.calc-result--danger .calc-result-value { color: var(--rose); }


/* ── Capacity bar ────────────────────────────────────────── */
.result-bar {
  width: 100%; height: 8px;
  background: var(--border2);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-basis: 100%;
  margin-top: 0.25rem;
}
.result-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 0.4s ease;
}
.calc-result--ok   .result-bar-fill { background: var(--success); }
.calc-result--warn .result-bar-fill { background: var(--amber); }
.calc-result--danger .result-bar-fill { background: var(--rose); }


/* ── Utility buttons ─────────────────────────────────────── */
.calc-actions {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}

.calc-reset-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.78rem;
  color: var(--muted); padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
  transition: color var(--transition-fast);
}
.calc-reset-btn:hover { color: var(--accent); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: inherit; font-size: 0.75rem; font-weight: 600;
  color: var(--muted); cursor: pointer;
  padding: 0.28rem 0.7rem;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }


/* ── Advanced options collapsible ────────────────────────── */
.calc-advanced {
  margin-top: 1rem;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calc-advanced summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
  cursor: pointer; list-style: none; user-select: none;
  background: var(--card2);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.calc-advanced summary::-webkit-details-marker { display: none; }
.calc-advanced summary:hover { color: var(--accent); background: var(--accent-lo); }

.calc-advanced-chev {
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.calc-advanced[open] .calc-advanced-chev { transform: rotate(180deg); }

.calc-advanced-body {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.calc-advanced-hint {
  font-size: 0.72rem; color: var(--muted2);
  margin-bottom: 0.75rem; line-height: 1.5;
}

/* ── ALM Checklist ───────────────────────────────────────── */
.alm-progress-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.alm-progress-bar {
  flex: 1; min-width: 120px; height: 8px;
  background: var(--border2); border-radius: var(--radius-full); overflow: hidden;
}
.alm-progress-fill {
  height: 100%; width: 0%; border-radius: var(--radius-full);
  background: var(--accent); transition: width 0.35s ease;
}
.alm-progress-label {
  font-size: 0.82rem; font-weight: 700; color: var(--accent); min-width: 2.5rem;
}
.alm-reset {
  font-size: 0.78rem; color: var(--muted); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
  background: none; border: none; font-family: inherit; padding: 0;
  transition: color var(--transition-fast);
}
.alm-reset:hover { color: var(--rose); }

.alm-cats { display: flex; flex-direction: column; gap: 1.1rem; }

.alm-cat {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}

.alm-cat-title {
  padding: 0.75rem 1rem;
  background: var(--card); border-bottom: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 700; color: var(--text);
  user-select: none;
}
.alm-cat-collapsed .alm-cat-title { border-bottom: none; }

.alm-items { padding: 0.4rem 0; }

.alm-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.6rem 1rem; cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border);
}
.alm-item:last-child { border-bottom: none; }
.alm-item:hover { background: rgba(0,120,212,.04); }

.alm-check {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  border: 2px solid var(--border2); background: var(--card);
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}
.alm-item.checked .alm-check {
  background: var(--accent); border-color: var(--accent);
}
.alm-item.checked .alm-check::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.alm-item-text {
  font-size: 0.85rem; color: var(--text); line-height: 1.5;
}
.alm-item.checked .alm-item-text {
  color: var(--muted2); text-decoration: line-through;
}
.alm-item-sub {
  font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem;
}


/* range slider inputs */
.calc-range-wrap {
  display: flex; align-items: center; gap: 0.6rem;
}
.calc-range {
  flex: 1; height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}
.calc-range-val {
  font-size: 0.82rem; font-weight: 700; color: var(--accent);
  min-width: 3rem; text-align: right;
}
