/* ============================================================================
   Shared look for the engine-rendered calculators at /tools/*.

   Layout only — each page sets its own accent with --te-accent on the body.
   ========================================================================== */

.te-scope { --te-accent: #1a6aff; --te-accent-2: #6c3fff; }

/* ── Hero ──────────────────────────────────────────────────────────────── */

.te-hero {
  background: linear-gradient(135deg, var(--te-accent) 0%, var(--te-accent-2) 100%);
  color: #fff; text-align: center; padding: 78px 20px 92px;
  position: relative; overflow: hidden;
}
.te-hero::before {
  content: ''; position: absolute; width: 480px; height: 480px;
  background: rgba(255, 255, 255, .06); border-radius: 50%;
  top: -160px; right: -110px; pointer-events: none;
}
.te-badge {
  display: inline-block; background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 50px;
  padding: 6px 18px; font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 16px; position: relative; z-index: 1;
}
.te-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800;
  margin: 0 0 14px; position: relative; z-index: 1;
}
.te-hero h1 .hl { color: #ffd93d; }
.te-hero p {
  font-size: 1.05rem; opacity: .88; max-width: 560px;
  margin: 0 auto; line-height: 1.7; position: relative; z-index: 1;
}

/* ── Tool card ─────────────────────────────────────────────────────────── */

.te-wrap { max-width: 780px; margin: -56px auto 70px; padding: 0 20px; position: relative; z-index: 10; }
.te-card {
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 18px 56px rgba(10, 37, 64, .14); border: 1.5px solid #eef0f8;
}
.te-mount { padding: 26px; }

/* ── Form ──────────────────────────────────────────────────────────────── */

.te-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.te-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.te-field label {
  font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #6b7280;
}
.te-field .te-unit { color: #9aa5b4; font-weight: 700; }
.te-field input, .te-field select {
  border: 1.5px solid #dbe3f0; border-radius: 12px; padding: 12px 14px;
  font-size: 1rem; font-family: inherit; color: #0f1b2d; background: #fff; width: 100%;
}
.te-field input:focus, .te-field select:focus {
  outline: none; border-color: var(--te-accent);
  box-shadow: 0 0 0 3px rgba(26, 106, 255, .12);
}
.te-field.bad input, .te-field.bad select { border-color: #ef4444; }
.te-field-toggle { flex-direction: row; align-items: center; gap: 10px; }
.te-field-toggle input { width: 20px; height: 20px; flex: none; }
.te-field-toggle label { order: 2; text-transform: none; font-size: .88rem; letter-spacing: 0; color: #4a5568; }
.te-hint { font-size: .74rem; color: #8a94a6; }
.te-err { font-size: .74rem; color: #dc2626; font-weight: 600; }

.te-error {
  display: none; margin-top: 16px; padding: 12px 16px;
  background: #fef2f2; border: 1.5px solid #fecaca; border-radius: 12px;
  color: #b91c1c; font-size: .86rem; font-weight: 600;
}
.te-error.on { display: block; }

/* ── Results ───────────────────────────────────────────────────────────── */

.te-out {
  display: none; margin-top: 22px; padding: 20px;
  background: #f8faff; border: 1.5px solid #e6ecf7; border-radius: 16px;
}
.te-out.on { display: block; }
.te-item {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 14px; padding: 9px 0; border-bottom: 1px solid #edf1f9; flex-wrap: wrap;
}
.te-item:last-child { border-bottom: none; }
.te-item-label { font-size: .88rem; color: #5a6a7a; }
.te-item-value { font-size: 1rem; font-weight: 800; color: #0f1b2d; text-align: right; }
.te-item-hint { flex: 1 0 100%; font-size: .76rem; color: #8a94a6; }
/* Prose returned by a runner: stacked and left-aligned, not right-aligned like a figure. */
.te-item-prose { flex-direction: column; align-items: stretch; gap: 4px; }
.te-item-prose .te-item-value {
  text-align: left; font-weight: 500; font-size: .88rem;
  line-height: 1.65; color: #5a6a7a;
}

/* Hashes, UUIDs and tagged URLs: monospace, stacked, and breakable at any character
   so a 128-character SHA-512 wraps inside the row instead of overflowing it. */
.te-item-code { flex-direction: column; align-items: stretch; gap: 4px; }
.te-item-code .te-item-value {
  text-align: left; font-weight: 600; font-size: .82rem;
  line-height: 1.6; color: #0f1b2d;
  word-break: break-all; overflow-wrap: anywhere;
}

.te-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; }

/* The headline number: the reason the page was opened. */
.te-item-hero { padding: 4px 0 14px; border-bottom: 2px solid #e6ecf7; }
.te-item-hero .te-item-label { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--te-accent); }
.te-item-hero .te-item-value { font-size: clamp(1.6rem, 5vw, 2.2rem); color: var(--te-accent); }

.te-section { margin: 18px 0 4px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a94a6; }

.te-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 16px 0 10px; background: #edf1f9; }
.te-bar-seg { display: block; height: 100%; }
.te-bar-0 { background: var(--te-accent); }
.te-bar-1 { background: var(--te-accent-2); }
.te-bar-2 { background: #f59e0b; }
.te-bar-3 { background: #10b981; }
.te-key { display: flex; flex-wrap: wrap; gap: 14px; }
.te-key-item { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: #5a6a7a; }
.te-key-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ── Long-form content ─────────────────────────────────────────────────── */

.te-content { max-width: 780px; margin: 0 auto 60px; padding: 0 20px; }
.te-content h2 { font-size: 1.5rem; font-weight: 800; color: #0f1b2d; margin: 44px 0 14px; }
.te-content h3 { font-size: 1.05rem; font-weight: 800; color: #0f1b2d; margin: 26px 0 8px; }
.te-content p, .te-content li { font-size: .95rem; color: #4a5568; line-height: 1.8; }
.te-content ul, .te-content ol { margin: 10px 0 10px 22px; }
.te-content a { color: var(--te-accent); }
.te-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .9rem; }
.te-content th, .te-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e6ecf7; }
.te-content th { font-weight: 800; color: #0f1b2d; background: #f8faff; }

.te-related { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.te-related a {
  background: #eef4ff; color: var(--te-accent); text-decoration: none;
  border-radius: 50px; padding: 8px 18px; font-size: .85rem; font-weight: 700;
}
.te-related a:hover { background: #dce8ff; }
