/* ============================================================
   AtomnyX Tools CSS — shared across all /tools/* pages
   Link alongside /css/style.css on every tool page
   ============================================================ */

/* ── Tool Hero ───────────────────────────────────────────────────────────── */
.tools-hero {
  padding-top: calc(var(--header-height) + var(--space-2xl));
  padding-bottom: var(--space-xl);
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  font-family: var(--font-mono);
}
.tool-breadcrumb a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.tool-breadcrumb a:hover { color: var(--color-primary-light); }
.tool-breadcrumb-sep { opacity: 0.5; }

.tool-page-header { margin-bottom: var(--space-2xl); }
.tool-page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}
.tool-subtitle {
  color: var(--color-text-secondary);
  font-size: 1rem;
  max-width: 580px;
  line-height: 1.6;
}

/* ── Calculator Card ─────────────────────────────────────────────────────── */
.tool-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
  max-width: 680px;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  margin-bottom: var(--space-xl);
}
.tool-tab {
  flex: 1 1 calc(50% - 0.25rem);
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
  line-height: 1.3;
}
.tool-tab:hover {
  color: var(--color-text);
  background: rgba(108, 92, 231, 0.1);
}
.tool-tab.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.35);
}

/* ── Mode question ───────────────────────────────────────────────────────── */
.tool-mode-question {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  font-family: var(--font-mono);
  min-height: 1.4em;
}
.tool-mode-question .hl { color: var(--color-primary-light); }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.tool-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  align-items: end;
  margin-bottom: var(--space-xl);
}
.tool-input-group { display: flex; flex-direction: column; gap: 0.35rem; }

.tool-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-family: var(--font-mono);
}

.tool-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 1.15rem;
  font-family: var(--font-mono);
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
  appearance: textfield;
}
.tool-input::-webkit-inner-spin-button,
.tool-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tool-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.tool-input::placeholder { color: var(--color-text-muted); font-weight: 400; }

.tool-input-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0.7rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  text-align: center;
}

/* ── Result ──────────────────────────────────────────────────────────────── */
.tool-result {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-lg);
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, background 0.3s;
}
.tool-result.has-result {
  border-color: rgba(108, 92, 231, 0.4);
  background: rgba(108, 92, 231, 0.04);
}

.tool-result-inner { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }

.tool-result-number {
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--color-primary-light);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}
.tool-result-number.empty { color: var(--color-text-muted); font-size: 2rem; }

.tool-result-suffix {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--color-accent);
  vertical-align: super;
  letter-spacing: 0;
}

.tool-result-explanation {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

/* ── Actions ─────────────────────────────────────────────────────────────── */
.tool-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}
.btn-copy-result { font-size: 0.84rem; }
.btn-copy-result.copied {
  background: var(--color-accent) !important;
  color: #000 !important;
  border-color: var(--color-accent) !important;
}

/* ── FAQ Accordion ───────────────────────────────────────────────────────── */
.tool-section { margin-top: var(--space-3xl); max-width: 760px; }
.tool-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-xl);
  color: var(--color-text);
}
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; }

.faq-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 0.93rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.faq-question:hover { color: var(--color-primary-light); }
.faq-icon {
  font-size: 1.25rem;
  color: var(--color-primary-light);
  transition: transform 0.25s;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer-inner {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  line-height: 1.75;
}
.faq-answer-inner code {
  font-family: var(--font-mono);
  background: var(--color-bg);
  padding: 0.1em 0.45em;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--color-accent);
}

/* ── SEO text ────────────────────────────────────────────────────────────── */
.tool-seo-content { max-width: 760px; margin-top: var(--space-3xl); }
.tool-seo-content h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: var(--space-sm); }
.tool-seo-content p, .tool-seo-content ul {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: var(--space-md);
}
.tool-seo-content ul { padding-left: 1.2rem; }

.tool-internal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--color-primary-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  transition: gap 0.2s;
}
.tool-internal-link:hover { gap: 0.5rem; }

/* ── Tools Hub grid ──────────────────────────────────────────────────────── */
.tools-hero-hub {
  padding-top: calc(var(--header-height) + var(--space-3xl));
  padding-bottom: var(--space-2xl);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}
.tool-hub-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.tool-hub-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: opacity 0.2s;
}
.tool-hub-card:not(.disabled):hover {
  border-color: rgba(108, 92, 231, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.15);
}
.tool-hub-card:not(.disabled):hover::before { opacity: 1; }
.tool-hub-card.disabled { opacity: 0.5; cursor: default; pointer-events: none; }

.tool-hub-icon {
  width: 44px;
  height: 44px;
  background: rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
}
.tool-hub-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}
.tool-hub-desc {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-md);
}
.tool-hub-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.2em 0.65em;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.tool-hub-badge.ready { background: rgba(0, 229, 160, 0.12); color: var(--color-accent); }
.tool-hub-badge.soon { background: rgba(108, 92, 231, 0.12); color: var(--color-primary-light); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tool-card { padding: var(--space-lg) var(--space-md); }

  .tool-inputs {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .tool-input-divider {
    padding-bottom: 0;
    padding: 0.15rem 0;
    justify-content: flex-start;
    font-size: 0.72rem;
  }

  .tool-result { padding: var(--space-md); min-height: 90px; }
  .tool-result-number { font-size: 2.4rem; }

  .tool-actions { flex-direction: column-reverse; }
  .tool-actions .btn { width: 100%; justify-content: center; text-align: center; }

  .tools-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   READING TIME CALCULATOR
   /tools/reading-time-calculator.html
   ════════════════════════════════════════════════════════════════ */

/* Wider card than the compact percentage calc */
.rt-card { max-width: 760px !important; }

/* ── Speed selector ──────────────────────────────────────────── */
.rt-speed-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.rt-speed-btns {
  display: flex;
  gap: var(--space-xs);
}

.rt-speed-btn {
  padding: 0.38rem 0.8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.rt-speed-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}
.rt-speed-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.35);
}

.rt-speed-wpm {
  display: block;
  font-size: 0.66rem;
  opacity: 0.75;
  font-weight: 400;
  margin-top: 1px;
}

/* ── Textarea wrap (anchors live count badge) ────────────────── */
.rt-textarea-wrap {
  position: relative;
  margin-top: 0.4rem;
}

/* ── Textarea ────────────────────────────────────────────────── */
.tool-textarea {
  display: block;
  width: 100%;
  min-height: 210px;
  padding: var(--space-md);
  padding-bottom: calc(var(--space-md) + 1.8rem); /* room for live count */
  background-color: var(--color-bg);
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.925rem;
  line-height: 1.7;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tool-textarea:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.tool-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.14);
}
.tool-textarea::placeholder {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ── Live word count badge ───────────────────────────────────── */
.rt-live-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.15em 0.7em;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.04em;
  line-height: 1.65;
  transition: color 0.2s, border-color 0.2s;
}
.rt-textarea-wrap:focus-within .rt-live-count {
  color: var(--color-primary-light);
  border-color: rgba(108, 92, 231, 0.35);
}

/* ── URL input group ─────────────────────────────────────────── */
.tool-url-group {
  display: flex;
  gap: var(--space-sm);
  margin-top: 0.4rem;
  align-items: flex-start;
}
.tool-url-group .tool-input {
  font-size: 0.88rem;
  font-weight: 400;
  font-family: var(--font-mono);
}

.rt-url-note {
  font-size: 0.77rem;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
}
.rt-url-status {
  font-size: 0.84rem;
  font-weight: 500;
  margin-top: 0.35rem;
  min-height: 1.3em;
}

/* ── Results grid (3-col: reading time full-width, 3 stats below) */
.rt-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-xl) 0 var(--space-lg);
}

.rt-result-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  transition: border-color var(--transition-fast);
}

/* Reading time spans the full row — visually dominant */
.rt-result-item.rt-primary {
  grid-column: 1 / -1;
  background: rgba(108, 92, 231, 0.05);
  border-color: rgba(108, 92, 231, 0.22);
  padding: var(--space-lg) var(--space-xl);
}

.rt-result-label {
  display: block;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  margin-bottom: 0.4rem;
}

.rt-result-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

.rt-primary .rt-result-label {
  color: var(--color-primary-light);
  opacity: 0.8;
}
.rt-primary .rt-result-value {
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--color-primary-light);
  letter-spacing: -0.02em;
}

/* ── Internal links row ──────────────────────────────────────── */
.rt-internal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .rt-card { max-width: 100% !important; }

  .rt-speed-group {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .rt-speed-btns { width: 100%; }
  .rt-speed-btn { flex: 1; }

  .tool-url-group { flex-direction: column; }
  .tool-url-group .btn { width: 100%; justify-content: center; }

  .rt-results {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }
  .rt-result-item.rt-primary { grid-column: 1 / -1; }
  .rt-primary .rt-result-value { font-size: 2rem; }
  .rt-result-value { font-size: 1.2rem; }
  .rt-result-item { padding: var(--space-sm) var(--space-md); }
}

/* ════════════════════════════════════════════════════════════════
   TIP CALCULATOR
   /tools/tip-calculator.html
   ════════════════════════════════════════════════════════════════ */

.tc-card { max-width: 680px !important; }

/* ── Bill row ────────────────────────────────────────────────── */
.tc-bill-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md);
  align-items: end;
  margin-bottom: var(--space-xl);
}

.tc-amount-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 0.4rem;
}

.tc-currency-symbol {
  position: absolute;
  left: 0.9rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.tc-bill-input {
  padding-left: 2.2rem !important;
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}

.tc-currency-wrap { min-width: 130px; }

.tc-currency-select {
  margin-top: 0.4rem;
  cursor: pointer;
  font-size: 0.88rem !important;
  padding-right: 2rem !important;
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236C5CE7' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

/* ── Generic section spacing ─────────────────────────────────── */
.tc-section { margin-bottom: var(--space-xl); }

/* ── Tip quick buttons ───────────────────────────────────────── */
.tc-tip-btns {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.tc-tip-btn {
  flex: 1 1 auto;
  min-width: 52px;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.tc-tip-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}
.tc-tip-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.35);
}

/* ── Custom % row ────────────────────────────────────────────── */
.tc-custom-pct-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.tc-custom-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.tc-custom-pct-group {
  position: relative;
  display: flex;
  align-items: center;
}

.tc-custom-pct-input {
  width: 88px !important;
  padding-right: 1.8rem !important;
  text-align: center;
  font-family: var(--font-mono) !important;
  font-size: 0.9rem !important;
}

.tc-pct-suffix {
  position: absolute;
  right: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}

/* ── People stepper row ──────────────────────────────────────── */
.tc-people-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.tc-people-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
  line-height: 1.4;
}

.tc-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.tc-stepper-btn {
  width: 40px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.25rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  line-height: 1;
  padding-bottom: 1px;
}
.tc-stepper-btn:hover {
  background: rgba(108, 92, 231, 0.1);
  color: var(--color-text);
}
.tc-stepper-btn:active { background: rgba(108, 92, 231, 0.2); }

.tc-stepper-input {
  width: 52px;
  height: 42px;
  border: none;
  border-left: 1.5px solid var(--color-border);
  border-right: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: textfield;
  outline: none;
  padding: 0;
}
.tc-stepper-input::-webkit-inner-spin-button,
.tc-stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Round up toggle row ─────────────────────────────────────── */
.tc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.tc-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
}
.tc-toggle.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.tc-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: transform 0.2s, background 0.2s;
}
.tc-toggle.active .tc-toggle-thumb {
  transform: translateX(22px);
  background: #fff;
}

/* ── Divider ─────────────────────────────────────────────────── */
.tc-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0 0 var(--space-xl);
  opacity: 0.5;
}

/* ── Results grid ────────────────────────────────────────────── */
.tc-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.tc-result-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  transition: border-color var(--transition-fast);
}

.tc-result-primary {
  grid-column: 1 / -1;
  background: rgba(108, 92, 231, 0.06);
  border-color: rgba(108, 92, 231, 0.22);
  padding: var(--space-lg) var(--space-xl);
}

.tc-result-label {
  display: block;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  margin-bottom: 0.4rem;
}

.tc-result-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

.tc-result-primary .tc-result-label {
  color: var(--color-primary-light);
  opacity: 0.8;
}
.tc-result-primary .tc-result-value {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--color-primary-light);
  letter-spacing: -0.02em;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tc-card { max-width: 100% !important; }

  .tc-bill-row { grid-template-columns: 1fr; }
  .tc-currency-wrap { min-width: 0; }

  .tc-tip-btn { flex: 1 1 calc(33.33% - 4px); min-width: 44px; }

  .tc-people-row,
  .tc-toggle-row { gap: var(--space-md); }

  .tc-results {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }
  .tc-result-primary { grid-column: 1 / -1; }
  .tc-result-primary .tc-result-value { font-size: 1.8rem; }
  .tc-result-value { font-size: 1.1rem; }
  .tc-result-item { padding: var(--space-sm) var(--space-md); }
}

/* ================================================================
   INVOICE GENERATOR  (.inv-*)
   All styles scoped to .inv-* — no conflicts with existing tools
   ================================================================ */

/* ── Card ───────────────────────────────────────────────────────── */
.inv-card {
  max-width: 900px !important;
  padding: var(--space-xl);
}

/* ── Toolbar ────────────────────────────────────────────────────── */
.inv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.inv-saved-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

.inv-saved-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.3s;
}
.inv-saved-dot--saving { background: #f39c12; }
.inv-saved-dot--saved  { background: #27ae60; }
.inv-saved-dot--error  { background: #e74c3c; }

.inv-toolbar-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.inv-pdf-btn {
  min-width: 148px;
}

/* ── Sections ───────────────────────────────────────────────────── */
.inv-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--color-border);
}

.inv-section--last {
  border-bottom: none;
  margin-bottom: 0.5rem;
}

.inv-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary-light);
  opacity: 0.75;
  margin: 0 0 0.9rem 0;
  font-family: var(--font-mono);
}

.inv-optional {
  font-weight: 400;
  opacity: 0.5;
  font-size: 0.8em;
}

/* ── Invoice details grid ───────────────────────────────────────── */
.inv-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem 1.1rem;
}

.inv-field { display: flex; flex-direction: column; }

/* ── Select ─────────────────────────────────────────────────────── */
.inv-select {
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236C5CE7' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px;
  padding-right: 2.2rem !important;
  cursor: pointer;
}

/* ── Textarea ───────────────────────────────────────────────────── */
.inv-textarea {
  resize: vertical;
  min-height: 72px;
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.55;
  font-family: inherit;
}

/* ── From / To ──────────────────────────────────────────────────── */
.inv-from-to {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.inv-party-fields {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.inv-party-fields--to {
  margin-top: 2.35rem; /* aligns "Client Name" with "Company Name" visually */
}

/* ── Logo upload ────────────────────────────────────────────────── */
.inv-logo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.inv-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
}
.inv-file-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}

.inv-clear-logo {
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
}
.inv-clear-logo:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.inv-logo-preview {
  max-width: 130px;
  max-height: 58px;
  border-radius: 6px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border: 1px solid var(--color-border);
  padding: 4px;
  background: rgba(255,255,255,0.03);
}

/* ── Line items ─────────────────────────────────────────────────── */
.inv-items-header {
  display: grid;
  grid-template-columns: 1fr 70px 110px 95px 34px;
  gap: 0.5rem;
  padding: 0.35rem 0 0.55rem;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0.4rem;
}

.inv-item-row {
  display: grid;
  grid-template-columns: 1fr 70px 110px 95px 34px;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.inv-item-total {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  padding-right: 0.1rem;
  letter-spacing: -0.01em;
}

.inv-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.inv-item-remove:hover {
  border-color: rgba(231, 76, 60, 0.6);
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.06);
}

.inv-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.55rem 1rem;
  background: none;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.inv-add-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}

/* ── Totals ─────────────────────────────────────────────────────── */
.inv-totals-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 0.25rem 0 1.75rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.inv-totals {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 260px;
}

.inv-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.inv-totals-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.inv-totals-amount {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.inv-totals-discount {
  color: #e74c3c;
}

.inv-grand-total-row {
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  border-top: 2px solid var(--color-border);
}
.inv-grand-total-row .inv-totals-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

.inv-totals-grand {
  font-size: 1.25rem !important;
  color: var(--color-primary-light) !important;
}

/* ── Actions ────────────────────────────────────────────────────── */
.inv-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

/* ── Tool link pills (More Tools section) ───────────────────────── */
.tool-link-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.tool-link-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .inv-card { padding: var(--space-lg); }

  .inv-details-grid { grid-template-columns: 1fr 1fr; }

  .inv-from-to { grid-template-columns: 1fr; gap: 1.25rem; }
  .inv-party-fields--to { margin-top: 0; }

  .inv-items-header { display: none; }

  .inv-item-row {
    grid-template-columns: 1fr 58px 88px 80px 28px;
    gap: 0.35rem;
  }

  .inv-totals { min-width: 0; width: 100%; }
  .inv-totals-wrap { justify-content: stretch; }

  .inv-toolbar { flex-direction: column; align-items: flex-start; }
  .inv-toolbar-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 480px) {
  .inv-card { padding: var(--space-md); }
  .inv-details-grid { grid-template-columns: 1fr; }

  .inv-item-row {
    grid-template-columns: 1fr 48px 76px 68px 26px;
    gap: 0.25rem;
  }

  .inv-actions { justify-content: stretch; }
  .inv-actions .btn { flex: 1; justify-content: center; }
}
