/* ────────────────────────────────────────────
   The Lazy Moogle Toolbox — assets.css
   ──────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;900&family=Crimson+Pro:ital,wght@0,300;0,400;1,300;1,400&display=swap');

/* ── Variables ── */
:root {
  --bg:         #070d1a;
  --surface:    #0c1628;
  --border:     rgba(90, 140, 255, 0.15);
  --blue:       #3a7bd5;
  --blue-light: #5a9bff;
  --blue-glow:  rgba(58, 123, 213, 0.35);
  --accent:     #7eb8ff;
  --text:       #c8d8f0;
  --muted:      #4a6080;
  --white:      #e8f0ff;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Pro', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Starfield background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(160,200,255,0.5) 0%, transparent 0%),
    radial-gradient(1px 1px at 34% 72%, rgba(160,200,255,0.4) 0%, transparent 0%),
    radial-gradient(1.5px 1.5px at 55% 9%,  rgba(160,200,255,0.6) 0%, transparent 0%),
    radial-gradient(1px 1px at 78% 55%, rgba(160,200,255,0.3) 0%, transparent 0%),
    radial-gradient(1px 1px at 91% 28%, rgba(160,200,255,0.5) 0%, transparent 0%),
    radial-gradient(1px 1px at 6%  85%, rgba(160,200,255,0.3) 0%, transparent 0%),
    radial-gradient(1.5px 1.5px at 47% 47%, rgba(160,200,255,0.4) 0%, transparent 0%),
    radial-gradient(1px 1px at 23% 62%, rgba(160,200,255,0.35) 0%, transparent 0%),
    radial-gradient(1px 1px at 67% 83%, rgba(160,200,255,0.4) 0%, transparent 0%),
    radial-gradient(1px 1px at 88% 91%, rgba(160,200,255,0.3) 0%, transparent 0%);
  pointer-events: none;
  z-index: 0;
}

/* ── Glow orb ── */
.bg-orb {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(58,123,213,0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Header ── */
header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 2rem 3rem;
  border-bottom: 1px solid var(--border);
  animation: reveal 0.6s ease 0.1s both;
}

.moogle-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  animation: bob 4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(90,155,255,0.6));
}

.site-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--white);
  letter-spacing: 0.06em;
  text-shadow: 0 0 40px var(--blue-glow), 0 2px 0 rgba(0,0,0,0.5);
  line-height: 1.1;
}

.site-title span { color: var(--blue-light); }

.site-subtitle {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Main / Grid ── */
main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: reveal 0.6s ease 0.3s both;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: reveal 0.6s ease both;
}

.card:nth-child(1) { animation-delay: 0.45s; }
.card:nth-child(2) { animation-delay: 0.55s; }
.card:nth-child(3) { animation-delay: 0.65s; }
.card:nth-child(4) { animation-delay: 0.75s; }

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(58,123,213,0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(90, 155, 255, 0.45);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.5),
    0 0 0 1px rgba(90,155,255,0.1),
    0 0 30px var(--blue-glow);
}

.card:hover::before { opacity: 1; }

/* ── Card preview ── */
.card-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Decorative grid overlay */
.card-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(90,155,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90,155,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.card-preview-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  transition: transform 0.4s ease;
}

.card:hover .card-preview-inner { transform: scale(1.05); }

/* Preview themes — add your own for new tools */
.preview-love {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(255,45,122,0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(180,0,80,0.2) 0%, transparent 60%),
    linear-gradient(135deg, #1a0510 0%, #0c1628 100%);
}

.preview-height {
  background:
    radial-gradient(ellipse at 50% 80%, rgba(58,200,130,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 20%, rgba(58,123,213,0.2) 0%, transparent 50%),
    linear-gradient(135deg, #081a12 0%, #0c1628 100%);
}

/* Add more preview themes as needed:
.preview-mynewool {
  background: ...;
}
*/

.preview-formatter {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(58,123,213,0.3) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 40%, rgba(90,200,180,0.2) 0%, transparent 50%),
    linear-gradient(135deg, #071220 0%, #0c1628 100%);
}

.preview-dante {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(200,30,30,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 30%, rgba(150,10,10,0.2) 0%, transparent 50%),
    linear-gradient(135deg, #1a0505 0%, #0a0608 100%);
}

.preview-bear {
  background:
    radial-gradient(ellipse at 40% 50%, rgba(120,80,255,0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 25%, rgba(80,40,180,0.2) 0%, transparent 50%),
    linear-gradient(135deg, #0a0818 0%, #080a0f 100%);
}

.preview-tz {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(58,123,213,0.3) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 65%, rgba(58,200,130,0.15) 0%, transparent 50%),
    linear-gradient(135deg, #061420 0%, #0c1628 100%);
}

.preview-age {
  background:
    radial-gradient(ellipse at 35% 50%, rgba(47,158,107,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 30%, rgba(30,110,75,0.22) 0%, transparent 50%),
    linear-gradient(135deg, #061a12 0%, #0c1628 100%);
}

.preview-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10,20,40,0.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  backdrop-filter: blur(6px);
  z-index: 1;
}

/* ── Card body ── */
.card-body {
  padding: 1.4rem 1.5rem 1.5rem;
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.card-footer {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tag {
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(58,123,213,0.1);
  border: 1px solid rgba(58,123,213,0.2);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.card-arrow {
  color: var(--blue-light);
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.card:hover .card-arrow { transform: translateX(4px); }

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
}

/* ── Animations ── */
@keyframes reveal {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Mobile ── */
@media (max-width: 500px) {
  header { padding: 2.5rem 1.2rem 2rem; }
  main   { padding: 2rem 1rem 4rem; }
  .grid  { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════════
   Tool pages — shared layout
   ════════════════════════════════════════════ */

body.tool-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.back-link {
  position: fixed;
  top: 1.2rem;
  left: 1.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
  z-index: 10;
}
.back-link:hover { color: var(--blue-light); }

.tool-header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: none;
  padding: 0;
  animation: reveal 0.5s ease 0.1s both;
}

.tool-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--white);
  text-shadow: 0 0 30px var(--blue-glow);
}

.tool-subtitle {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
  margin-top: 0.3rem;
}

.tool-footer {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--muted);
  opacity: 0.5;
  text-align: center;
  border-top: none;
  padding: 0;
}


/* ════════════════════════════════════════════
   Height Calculator
   ════════════════════════════════════════════ */

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(58,123,213,0.1);
  animation: reveal 0.5s ease 0.25s both;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 1.75rem;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: var(--surface2, #111e35);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* Sections */
.section { display: none; }
.section.active { display: block; }

.field-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 10px;
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

input {
  width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1.4rem;
  font-family: 'Crimson Pro', serif;
  font-weight: 400;
  color: var(--white);
  background: rgba(58,123,213,0.06);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button { -webkit-appearance: none; }

input::placeholder { color: var(--muted); opacity: 0.5; }

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(58,123,213,0.2);
}

input.error { border-color: #e05c7a; }

.unit {
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
  padding-bottom: 12px;
}

/* Result box */
.result-box {
  background: rgba(58,123,213,0.07);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.result-box::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(58,123,213,0.2), transparent 70%);
  pointer-events: none;
}

.result-main {
  font-family: 'Cinzel', serif;
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1;
  text-shadow: 0 0 20px var(--blue-glow);
}

.result-sub {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--blue-light);
  margin-top: 8px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* Decimal row */
.dec-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dec-label {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--muted);
}

.dec-btn {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.dec-btn.active {
  background: rgba(58,123,213,0.12);
  color: var(--accent);
  border-color: var(--blue);
  font-weight: 600;
}

@media (max-width: 400px) {
  .tool-card { padding: 1.4rem 1rem; border-radius: 14px; }
  input { width: 90px; font-size: 1.2rem; }
}


/* ════════════════════════════════════════════
   Formatter & Preview
   ════════════════════════════════════════════ */

body.formatter-page {
  justify-content: flex-start;
  align-items: center;
  padding: 0;
}

body.formatter-page .tool-header {
  width: 100%;
  text-align: center;
  padding: 3rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  animation: reveal 0.5s ease 0.1s both;
}

.fmt-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
  gap: 0.85rem;
  animation: reveal 0.5s ease 0.2s both;
}

/* ── Mode tabs ── */
.fmt-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.fmt-tab {
  padding: 0.5rem 1.4rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.fmt-tab.active {
  background: rgba(58,123,213,0.18);
  color: var(--blue-light);
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* ── Convert bar ── */
.fmt-convert-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.fmt-convert-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fmt-convert-select label {
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.fmt-convert-select select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--white);
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  padding: 0.4rem 0.7rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.fmt-convert-select select:focus {
  border-color: var(--blue);
}

.fmt-convert-arrow {
  color: var(--blue-light);
  font-size: 1.2rem;
  padding-bottom: 0.5rem;
}

@media (max-width: 500px) {
  .fmt-convert-bar {
    flex-wrap: wrap;
  }
  .fmt-convert-arrow {
    display: none;
  }
}

/* ── Toolbar ── */
.fmt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
}

.fmt-tb-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

.fmt-tb-btn:hover {
  background: rgba(58,123,213,0.12);
  border-color: var(--blue);
  color: var(--blue-light);
}

.fmt-tb-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Editor / Preview body ── */
.fmt-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 380px;
}

.fmt-editor-col,
.fmt-preview-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fmt-col-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fmt-preview-note {
  font-style: italic;
  font-family: 'Crimson Pro', serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
  color: rgba(74,96,128,0.6);
}

.fmt-editor {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--white);
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  line-height: 1.7;
  padding: 1.2rem;
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 520px;
  text-transform: none;
  font-variant: none;
}

.fmt-editor:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(58,123,213,0.15);
}

.fmt-preview-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  overflow-y: auto;
  min-height: 520px;
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.75;
  text-transform: none;
  font-variant: none;
}

.fmt-preview-box * {
  text-transform: none;
  font-variant: none;
  font-family: inherit;
}

/* Preview content styling */
.fmt-preview-box h1,
.fmt-preview-box h2,
.fmt-preview-box h3 {
  font-family: 'Cinzel', serif;
  color: var(--white);
  margin: 1rem 0 0.5rem;
  letter-spacing: 0.03em;
}
.fmt-preview-box h1 { font-size: 1.6rem; }
.fmt-preview-box h2 { font-size: 1.25rem; }
.fmt-preview-box h3 { font-size: 1rem; }

.fmt-preview-box p { margin-bottom: 0.75rem; }

.fmt-preview-box a {
  color: var(--blue-light);
  text-decoration: underline;
  text-decoration-color: rgba(90,155,255,0.4);
}

.fmt-preview-box code {
  font-family: 'Courier New', monospace;
  background: rgba(58,123,213,0.1);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 0.85em;
  color: var(--accent);
}

.fmt-preview-box pre,
.bb-code {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0.75rem 0;
}

.fmt-preview-box ul,
.fmt-preview-box ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.fmt-preview-box blockquote,
.bb-quote {
  border-left: 3px solid var(--blue);
  margin: 0.75rem 0;
  padding: 0.5rem 1rem;
  background: rgba(58,123,213,0.06);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-style: italic;
}

.bb-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--blue-light);
  margin-bottom: 0.3rem;
}

.bb-spoiler {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  background: rgba(58,123,213,0.05);
  margin: 0.5rem 0;
}

.bb-spoiler summary {
  cursor: pointer;
  color: var(--blue-light);
  font-size: 0.85rem;
  font-style: italic;
}

.fmt-preview-box hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.fmt-preview-box img {
  max-width: 100%;
  border-radius: 4px;
}

.fmt-preview-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Action bar ── */
.fmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.fmt-btn {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.fmt-btn:hover {
  background: rgba(58,123,213,0.1);
  border-color: var(--blue);
  color: var(--blue-light);
}

.fmt-btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 0 2px 12px rgba(58,123,213,0.4);
}

.fmt-btn-primary:hover {
  background: var(--blue-light);
  border-color: var(--blue-light);
  color: white;
  box-shadow: 0 2px 20px rgba(90,155,255,0.5);
}

.fmt-btn-danger:hover {
  background: rgba(220,60,60,0.12);
  border-color: #dc3c3c;
  color: #f08080;
}

.fmt-charcount {
  margin-left: auto;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--muted);
}

/* ── Toast ── */
.fmt-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--blue);
  color: white;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(58,123,213,0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
}

.fmt-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .fmt-body {
    grid-template-columns: 1fr;
  }
  .fmt-editor, .fmt-preview-box {
    min-height: 320px;
  }
  body.formatter-page .tool-header {
    padding: 2rem 1rem 1rem;
  }
  .fmt-wrap {
    padding: 1rem 1rem 2rem;
  }
  .fmt-charcount {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }
}


/* ════════════════════════════════════════════
   Zeitzonen & Zeitspannen
   ════════════════════════════════════════════ */

body.tz-page {
  justify-content: flex-start;
  align-items: center;
  padding: 0;
}

body.tz-page .tool-header {
  width: 100%;
  text-align: center;
  padding: 3rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.tz-wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* ── Main tabs ── */
.tz-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

.tz-tab {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.tz-tab.active {
  background: rgba(58,123,213,0.18);
  color: var(--blue-light);
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* ── Panels ── */
.tz-panel { display: none; flex-direction: column; gap: 1.2rem; }
.tz-panel.active { display: flex; }

/* ── Sub-tabs (Duration Calculator) ── */
.tz-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.tz-subtab {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  font-style: italic;
  cursor: pointer;
  transition: all 0.2s;
}

.tz-subtab.active {
  background: rgba(58,123,213,0.12);
  color: var(--blue-light);
  border-color: var(--blue);
}

.tz-subpanel { display: none; }
.tz-subpanel.active { display: block; }

/* ── Card ── */
.tz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.tz-field { margin-bottom: 1.3rem; }
.tz-field:last-of-type { margin-bottom: 0.5rem; }

.tz-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.tz-row {
  display: flex;
  gap: 0.6rem;
}

.tz-input {
  flex: 1;
  background: rgba(58,123,213,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--white);
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  color-scheme: dark;
}

.tz-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(58,123,213,0.15);
}

/* Recolor & enlarge native date/time picker icon */
input[type="date"].tz-input::-webkit-calendar-picker-indicator,
input[type="time"].tz-input::-webkit-calendar-picker-indicator {
  filter: invert(72%) sepia(45%) saturate(1000%) hue-rotate(190deg) brightness(105%);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
}

input[type="date"].tz-input::-webkit-calendar-picker-indicator:hover,
input[type="time"].tz-input::-webkit-calendar-picker-indicator:hover {
  background: rgba(58,123,213,0.2);
}

/* Recolor number input spinner arrows (Firefox) */
.tz-num {
  -moz-appearance: textfield;
}

/* Style number input spinner arrows (Webkit) individually instead of hiding */
.tz-num::-webkit-inner-spin-button,
.tz-num::-webkit-outer-spin-button {
  opacity: 1;
  filter: invert(60%) sepia(50%) saturate(900%) hue-rotate(190deg);
  cursor: pointer;
}

.tz-num {
  text-align: center;
}

/* ── Zeitzonen-Suche ── */
.tz-search-wrap { position: relative; }

.tz-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--blue);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
}

.tz-dropdown.visible { display: block; }

.tz-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.15s;
  border-bottom: 1px solid rgba(58,123,213,0.08);
}

.tz-dropdown-item:last-child { border-bottom: none; }
.tz-dropdown-item:hover { background: rgba(58,123,213,0.12); }

.tz-dropdown-offset {
  font-size: 0.75rem;
  color: var(--blue-light);
  font-style: italic;
}

.tz-dropdown-empty {
  padding: 0.8rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.tz-current-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--muted);
}

/* ── Chips (Ziel-Zeitzonen) ── */
.tz-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.tz-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(58,123,213,0.12);
  border: 1px solid rgba(58,123,213,0.3);
  border-radius: 999px;
  padding: 0.3rem 0.4rem 0.3rem 0.8rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--accent);
}

.tz-chip button {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.65rem;
  line-height: 1;
  transition: background 0.15s;
}

.tz-chip button:hover { background: rgba(220,60,60,0.3); }

/* ── Swap button ── */
.tz-swap-btn {
  align-self: center;
  background: var(--surface2, #111e35);
  border: 1px solid var(--border);
  color: var(--blue-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin: -0.5rem 0;
}

.tz-swap-btn:hover {
  border-color: var(--blue);
  transform: rotate(180deg);
}

/* ── Add-grid (Zeitspanne Felder) ── */
.tz-add-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.tz-add-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.tz-add-item span {
  font-size: 0.65rem;
  font-style: italic;
  color: var(--muted);
}

.tz-direction {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.9rem;
}

.tz-radio {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--muted);
  cursor: pointer;
}

.tz-radio input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid rgba(58,123,213,0.4);
  border-radius: 50%;
  background: rgba(58,123,213,0.06);
  cursor: pointer;
  position: relative;
  margin: 0;
  padding: 0;
  transition: border-color 0.15s;
}

.tz-radio input[type="radio"]:checked {
  border-color: var(--blue);
}

.tz-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-light);
  box-shadow: 0 0 6px rgba(90,155,255,0.6);
}

/* ── Button ── */
.tz-btn {
  width: 100%;
  background: var(--blue);
  color: white;
  border: none;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 4px 20px rgba(58,123,213,0.4);
  margin-top: 0.5rem;
}

.tz-btn:hover {
  background: var(--blue-light);
  box-shadow: 0 4px 30px rgba(90,155,255,0.5);
  transform: translateY(-1px);
}

/* ── Result ── */
.tz-result:empty { display: none; }

.tz-result {
  background: rgba(58,200,130,0.05);
  border: 1px solid rgba(58,200,130,0.2);
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  animation: reveal 0.4s ease;
}

.tz-result-header {
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(58,200,130,0.15);
}

.tz-result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(58,123,213,0.08);
}

.tz-result-row:last-child { border-bottom: none; }

.tz-result-tz {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tz-result-time {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--green, #3ac882);
  text-shadow: 0 0 15px rgba(58,200,130,0.4);
  align-self: center;
}

.tz-result-date {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  font-size: 0.85rem;
  color: var(--text);
}

.tz-result-diff {
  grid-column: 1 / 3;
  grid-row: 3 / 4;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--blue-light);
  margin-top: 0.2rem;
}

.tz-duration-big {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--green, #3ac882);
  text-shadow: 0 0 15px rgba(58,200,130,0.4);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.tz-duration-alt {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
}

.tz-error {
  color: #f08080;
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Mobile ── */
@media (max-width: 500px) {
  .tz-wrap { padding: 1.2rem 1rem 2rem; }
  .tz-card { padding: 1.1rem; }
  .tz-add-grid { grid-template-columns: repeat(3, 1fr); }
  .tz-tab { font-size: 0.55rem; padding: 0.55rem 0.4rem; }
  .tz-subtabs { flex-direction: column; }
  .tz-result-time { font-size: 1.3rem; }
}


/* ════════════════════════════════════════════
   Age Converter — green theme
   ════════════════════════════════════════════ */

.age-page .tool-title,
.age-page .site-title {
  text-shadow: 0 0 40px rgba(47,158,107,0.4), 0 2px 0 rgba(0,0,0,0.5);
}

.age-page .tool-subtitle {
  color: #6a9a82;
}

.age-page .back-link {
  color: #6a9a82;
}

.age-page .back-link:hover {
  color: #4fc98f;
}

.age-page .tool-card {
  background: #0a1c15;
  border: 1px solid rgba(70,200,140,0.35);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(47,158,107,0.18);
}

.age-page .tabs {
  background: #0c2419;
}

.age-page .tab {
  color: #7ab399;
}

.age-page .tab.active {
  background: #1a4a30;
  color: #8ff5bd;
}

.age-page .field-label {
  color: #6a9a82;
}

.age-page input {
  background: rgba(47,158,107,0.09);
  border: 1px solid rgba(70,200,140,0.35);
  color: #e8fff0;
}

.age-page input::placeholder {
  color: #6a9a82;
  opacity: 0.5;
}

.age-page input:focus {
  border-color: #2f9e6b;
  box-shadow: 0 0 0 3px rgba(47,158,107,0.25);
}

.age-page input.error {
  border-color: #e05c7a;
}

.age-page .unit {
  color: #6a9a82;
}

.age-page .result-box {
  background: rgba(47,158,107,0.1);
  border: 1px solid rgba(70,200,140,0.35);
}

.age-page .result-box::before {
  background: radial-gradient(circle, rgba(47,158,107,0.3), transparent 70%);
}

.age-page .result-main {
  color: #6fe3ac;
  text-shadow: 0 0 20px rgba(47,158,107,0.4);
}

.age-page .result-sub {
  color: #4fc98f;
}

.age-page .divider {
  border-top: 1px solid rgba(70,200,140,0.25);
}

.age-page .dec-btn {
  border: 1px solid rgba(70,200,140,0.35);
  color: #6a9a82;
}

.age-page .dec-btn.active {
  background: rgba(47,158,107,0.18);
  color: #6fe3ac;
  border-color: #2f9e6b;
}

.age-page .dec-label {
  color: #6a9a82;
}

.age-page .tool-footer {
  color: #6a9a82;
}

.age-page .species-row {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.age-page .species-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid rgba(70,200,140,0.3);
  border-radius: 10px;
  background: rgba(47,158,107,0.06);
  color: #6a9a82;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.age-page .species-btn.active {
  background: rgba(47,158,107,0.2);
  color: #6fe3ac;
  border-color: #2f9e6b;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(47,158,107,0.2);
}

.age-page .curve-note {
  font-size: 0.78rem;
  font-style: italic;
  color: #6a9a82;
  line-height: 1.5;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(70,200,140,0.25);
}

.age-page .curve-note strong {
  color: #4fc98f;
  font-style: normal;
}

@media (max-width: 400px) {
  .age-page .tool-card { padding: 1.4rem 1rem; border-radius: 14px; }
  .age-page input { width: 90px; font-size: 1.2rem; }
}

.age-page {
  background: #050f0a;
}

.age-page::before {
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(140,255,190,0.5) 0%, transparent 0%),
    radial-gradient(1px 1px at 34% 72%, rgba(140,255,190,0.4) 0%, transparent 0%),
    radial-gradient(1.5px 1.5px at 55% 9%,  rgba(140,255,190,0.6) 0%, transparent 0%),
    radial-gradient(1px 1px at 78% 55%, rgba(140,255,190,0.3) 0%, transparent 0%),
    radial-gradient(1px 1px at 91% 28%, rgba(140,255,190,0.5) 0%, transparent 0%),
    radial-gradient(1px 1px at 6%  85%, rgba(140,255,190,0.3) 0%, transparent 0%),
    radial-gradient(1.5px 1.5px at 47% 47%, rgba(140,255,190,0.4) 0%, transparent 0%),
    radial-gradient(1px 1px at 23% 62%, rgba(140,255,190,0.35) 0%, transparent 0%),
    radial-gradient(1px 1px at 67% 83%, rgba(140,255,190,0.4) 0%, transparent 0%),
    radial-gradient(1px 1px at 88% 91%, rgba(140,255,190,0.3) 0%, transparent 0%);
}
