/* OceanofTools Mathematical Tools — shared realistic calculator interface */
:root {
  --mt-primary: #2563eb;
  --mt-primary-dark: #1d4ed8;
  --mt-accent: #7c3aed;
  --mt-cyan: #0891b2;
  --mt-success: #059669;
  --mt-danger: #dc2626;
  --mt-text: #172033;
  --mt-muted: #667085;
  --mt-border: #dbe4f0;
  --mt-surface: #ffffff;
  --mt-soft: #f5f8fc;
  --mt-soft-blue: #eef4ff;
  --mt-shadow: 0 20px 50px rgba(24, 51, 89, .11);
  --mt-shadow-soft: 0 10px 28px rgba(24, 51, 89, .075);
  --mt-radius: 22px;
}

body.math-tools-theme {
  background: linear-gradient(180deg, #f7f9fd 0, #f2f5fa 100%);
  color: var(--mt-text);
}

body.math-tools-theme *,
body.math-tools-theme *::before,
body.math-tools-theme *::after { box-sizing: border-box; }
body.math-tools-theme img { max-width: 100%; }
body.math-tools-theme main { overflow: hidden; }

.mt-page,
.mt-section,
body.math-tools-theme .related-tools {
  width: min(1180px, calc(100% - 28px));
  margin-left: auto;
  margin-right: auto;
}

.mt-page { padding: 0 0 38px; }
.mt-section { padding: 34px 0 54px; }

.mt-hero {
  position: relative;
  width: min(1180px, calc(100% - 28px));
  margin: 26px auto 24px;
  padding: clamp(34px, 6vw, 66px) clamp(22px, 5vw, 56px);
  border: 1px solid #dce7fb;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,249,255,.94)),
    linear-gradient(135deg, #fff, #f3f7ff);
  box-shadow: var(--mt-shadow);
  text-align: center;
  isolation: isolate;
}

.mt-hero-content { position: relative; z-index: 2; }
.mt-hero-orb { position: absolute; border-radius: 999px; filter: blur(2px); opacity: .7; z-index: 0; pointer-events: none; }
.mt-orb-one { width: 260px; height: 260px; top: -110px; right: -70px; background: radial-gradient(circle, rgba(124,58,237,.22), transparent 68%); }
.mt-orb-two { width: 280px; height: 280px; bottom: -150px; left: -90px; background: radial-gradient(circle, rgba(37,99,235,.22), transparent 68%); }

.mt-hero-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: #fff;
  font-size: 2.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--mt-primary), var(--mt-accent));
  box-shadow: 0 16px 30px rgba(37, 99, 235, .28);
}

.mt-eyebrow,
.mt-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--mt-primary);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.mt-hero h1 {
  max-width: 900px;
  margin: 10px auto 14px;
  color: var(--mt-text);
  font-size: clamp(2.05rem, 5vw, 3.55rem);
  line-height: 1.06;
  letter-spacing: -.042em;
}
.mt-hero p {
  max-width: 820px;
  margin: 0 auto;
  color: var(--mt-muted);
  font-size: clamp(1rem, 2vw, 1.13rem);
  line-height: 1.75;
}
.mt-trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.mt-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #dce7f7;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  color: #41516b;
  font-size: .86rem;
  font-weight: 700;
}
.mt-trust-row i { color: var(--mt-primary); }

.mt-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--mt-muted);
  font-size: .9rem;
}
.mt-breadcrumbs a { color: var(--mt-primary); text-decoration: none; font-weight: 750; }
.mt-breadcrumbs a:hover { text-decoration: underline; }

.mt-calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr);
  gap: 22px;
  align-items: start;
}

.mt-calculator-card,
.mt-reference-card,
.mt-detail-card,
.mt-step-card,
.mt-tool-card,
.mt-info-card {
  border: 1px solid var(--mt-border);
  background: var(--mt-surface);
  box-shadow: var(--mt-shadow-soft);
}

.mt-calculator-card {
  padding: clamp(22px, 4vw, 36px);
  border-radius: var(--mt-radius);
}
.mt-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e6edf6;
}
.mt-card-heading h2,
.mt-reference-card h2,
.mt-section-heading h2,
.mt-detail-card h2 {
  margin: 6px 0 8px;
  color: var(--mt-text);
  line-height: 1.2;
  letter-spacing: -.025em;
}
.mt-card-heading h2 { font-size: clamp(1.55rem, 3vw, 2rem); }
.mt-card-heading p { margin: 0; color: var(--mt-muted); line-height: 1.65; }
.mt-live-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #047857;
  font-size: .82rem;
  font-weight: 800;
}
.mt-live-badge span { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.13); }

.mt-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.mt-field { min-width: 0; }
.mt-field.mt-full { grid-column: 1 / -1; }
.mt-field[hidden] { display: none !important; }
.mt-field label {
  display: block;
  margin: 0 0 8px;
  color: #26364f;
  font-size: .92rem;
  font-weight: 800;
}
.mt-field small {
  display: block;
  margin-top: 7px;
  color: var(--mt-muted);
  font-size: .79rem;
  line-height: 1.45;
}
.mt-control { position: relative; }
.mt-control input,
.mt-control select,
.mt-control textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cfd9e8;
  border-radius: 14px;
  background: #fff;
  color: var(--mt-text);
  font: inherit;
  font-size: .98rem;
  padding: 13px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.mt-control textarea { min-height: 126px; resize: vertical; line-height: 1.55; }
.mt-control select { cursor: pointer; }
.mt-control input:focus,
.mt-control select:focus,
.mt-control textarea:focus {
  border-color: var(--mt-primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
  background: #fbfdff;
}
.mt-control.has-prefix input { padding-left: 42px; }
.mt-control.has-suffix input { padding-right: 64px; }
.mt-affix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: #667085;
  font-size: .85rem;
  font-weight: 800;
  pointer-events: none;
}
.mt-prefix { left: 14px; }
.mt-suffix { right: 14px; }

.mt-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 24px; }
.mt-btn,
.mt-copy-btn {
  border: 0;
  border-radius: 13px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.mt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 17px;
}
.mt-btn:hover,
.mt-copy-btn:hover { transform: translateY(-2px); }
.mt-btn.primary { color: #fff; background: linear-gradient(135deg, var(--mt-primary), var(--mt-accent)); box-shadow: 0 10px 24px rgba(37,99,235,.22); }
.mt-btn.secondary { color: #1e40af; background: #eef4ff; border: 1px solid #d4e2ff; }
.mt-btn.ghost { color: #475467; background: #f6f8fb; border: 1px solid #dfe6ef; }

.mt-result {
  display: none;
  margin-top: 26px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid #bfd3ff;
  border-radius: 18px;
  background: linear-gradient(145deg, #f7faff, #eef4ff);
}
.mt-result.show { display: block; animation: mtFade .25s ease; }
.mt-result.error { border-color: #fecaca; background: #fff7f7; }
@keyframes mtFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.mt-result-header { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 15px; }
.mt-result-header h2 { margin: 4px 0 0; font-size: 1.45rem; }
.mt-copy-btn { padding: 9px 12px; color: #1d4ed8; background: #fff; border: 1px solid #cfe0ff; }
.mt-result-value {
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #dbe7fb;
  box-shadow: 0 8px 20px rgba(37,99,235,.07);
}
.mt-result-value .mt-answer-label { display: block; color: var(--mt-muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.mt-result-value .mt-answer-number { display: block; margin-top: 5px; color: #133f96; font-size: clamp(1.65rem, 4vw, 2.45rem); font-weight: 900; line-height: 1.18; overflow-wrap: anywhere; }
.mt-result-details { margin-top: 15px; }
.mt-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.mt-result-metric { padding: 13px 14px; border: 1px solid #dce6f5; border-radius: 13px; background: rgba(255,255,255,.86); }
.mt-result-metric span { display: block; color: var(--mt-muted); font-size: .76rem; font-weight: 750; }
.mt-result-metric strong { display: block; margin-top: 4px; color: var(--mt-text); font-size: 1rem; overflow-wrap: anywhere; }
.mt-calculation-note { margin-top: 12px; padding: 14px; border-left: 4px solid var(--mt-primary); border-radius: 0 12px 12px 0; background: rgba(255,255,255,.82); color: #42526b; line-height: 1.65; }
.mt-calculation-note code { color: #173f8f; font-weight: 800; white-space: normal; overflow-wrap: anywhere; }
.mt-result.error .mt-answer-number { color: var(--mt-danger); font-size: 1.35rem; }

.mt-reference-card {
  position: sticky;
  top: 18px;
  padding: 25px;
  border-radius: var(--mt-radius);
}
.mt-reference-card h2 { font-size: 1.55rem; }
.mt-reference-card > p { color: var(--mt-muted); line-height: 1.7; }
.mt-formula-box {
  margin: 18px 0;
  padding: 16px;
  border-radius: 15px;
  background: linear-gradient(135deg, #172554, #1e3a8a);
  color: #fff;
}
.mt-formula-box span { display: block; margin-bottom: 7px; color: #bfdbfe; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.mt-formula-box code { color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .94rem; white-space: normal; line-height: 1.6; }
.mt-example-box,
.mt-privacy-note { display: flex; gap: 12px; padding: 15px; border-radius: 15px; }
.mt-example-box { margin-top: 18px; background: #fff8e8; border: 1px solid #f7dfaa; }
.mt-example-box i { color: #d97706; margin-top: 3px; }
.mt-example-box strong,
.mt-privacy-note strong { display: block; color: var(--mt-text); }
.mt-example-box p { margin: 5px 0 0; color: #6b5a32; font-size: .88rem; line-height: 1.55; }
.mt-privacy-note { margin-top: 14px; background: #ecfdf3; border: 1px solid #bce9cf; }
.mt-privacy-note i { color: var(--mt-success); margin-top: 3px; }
.mt-privacy-note span { display: block; margin-top: 4px; color: #4d6b5b; font-size: .84rem; line-height: 1.5; }

.mt-section-heading { max-width: 780px; margin: 0 auto 24px; text-align: center; }
.mt-section-heading h2 { font-size: clamp(1.75rem, 4vw, 2.45rem); }
.mt-section-heading p { margin: 0; color: var(--mt-muted); line-height: 1.7; }
.mt-how-section { padding-top: 18px; }
.mt-step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mt-step-card { position: relative; min-height: 145px; padding: 22px; border-radius: 18px; }
.mt-step-card span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--mt-primary), var(--mt-accent)); font-weight: 900; box-shadow: 0 8px 18px rgba(37,99,235,.2); }
.mt-step-card p { margin: 15px 0 0; color: #45546c; line-height: 1.65; }

.mt-detail-grid { display: grid; grid-template-columns: 1.15fr .9fr .9fr; gap: 18px; }
.mt-detail-card { padding: 24px; border-radius: 20px; }
.mt-detail-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--mt-soft-blue); color: var(--mt-primary); font-size: 1.15rem; }
.mt-detail-card h2 { font-size: 1.35rem; }
.mt-detail-card > p { color: var(--mt-muted); line-height: 1.7; }
.mt-inline-formula { padding: 13px; border-radius: 12px; background: #f4f7fb; border: 1px solid #dce4ef; }
.mt-inline-formula code { color: #173f8f; white-space: normal; overflow-wrap: anywhere; font-weight: 800; line-height: 1.55; }
.mt-muted-copy { font-size: .88rem; }
.mt-check-list { list-style: none; padding: 0; margin: 16px 0 0; }
.mt-check-list li { display: flex; gap: 9px; align-items: flex-start; margin: 11px 0; color: #46556d; line-height: 1.55; }
.mt-check-list i { flex: 0 0 auto; margin-top: 4px; color: var(--mt-success); }
.mt-tip-list i { color: var(--mt-primary); }

.mt-faq-section { width: min(1180px, calc(100% - 28px)); margin: 0 auto 50px; padding: 30px 0 0; background: transparent !important; }
.mt-faq-section .faq-container-unique { max-width: none; padding: 0; }
.mt-faq-section .faq-grid-unique { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.mt-faq-section .faq-item-unique { margin: 0; padding: 21px; border: 1px solid var(--mt-border); border-radius: 18px; background: #fff; box-shadow: var(--mt-shadow-soft); }
.mt-faq-section .faq-item-unique h3 { margin: 0 0 8px; color: var(--mt-text); font-size: 1rem; }
.mt-faq-section .faq-item-unique p { margin: 0; color: var(--mt-muted); line-height: 1.65; }

/* Mathematical tools index */
.mt-directory-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 12px;
  width: min(880px, calc(100% - 28px));
  margin: 0 auto 24px;
}
.mt-directory-controls input,
.mt-directory-controls select {
  min-height: 52px;
  width: 100%;
  border: 1px solid var(--mt-border);
  border-radius: 14px;
  background: #fff;
  color: var(--mt-text);
  padding: 12px 15px;
  font: inherit;
  outline: none;
  box-shadow: 0 8px 20px rgba(31,49,80,.055);
}
.mt-directory-controls input:focus,
.mt-directory-controls select:focus { border-color: var(--mt-primary); box-shadow: 0 0 0 4px rgba(37,99,235,.11); }
.mt-directory-status { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; color: var(--mt-muted); font-size: .9rem; }
.mt-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.mt-tool-card { display: flex; flex-direction: column; min-height: 225px; padding: 21px; border-radius: 19px; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.mt-tool-card:hover { transform: translateY(-5px); border-color: #b9cced; box-shadow: 0 18px 40px rgba(24,51,89,.13); }
.mt-tool-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #eff5ff, #f5efff); color: #264d98; font-weight: 900; font-size: 1.3rem; }
.mt-tool-card h3 { margin: 15px 0 7px; color: var(--mt-text); font-size: 1.06rem; line-height: 1.35; }
.mt-tool-card p { margin: 0; color: var(--mt-muted); font-size: .9rem; line-height: 1.55; }
.mt-tool-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 16px; color: var(--mt-primary); font-size: .78rem; font-weight: 800; }
.mt-tool-meta span:first-child { padding: 5px 8px; border-radius: 999px; background: #eef4ff; }
.mt-empty { display: none; padding: 30px; border: 1px dashed var(--mt-border); border-radius: 18px; background: #fff; color: var(--mt-muted); text-align: center; }
.mt-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mt-info-card { padding: 22px; border-radius: 18px; }
.mt-info-card h3 { margin: 0 0 8px; color: var(--mt-text); }
.mt-info-card p { margin: 0; color: var(--mt-muted); line-height: 1.65; }

@media (max-width: 980px) {
  .mt-calculator-layout { grid-template-columns: 1fr; }
  .mt-reference-card { position: static; }
  .mt-detail-grid { grid-template-columns: 1fr 1fr; }
  .mt-detail-card:first-child { grid-column: 1 / -1; }
  .mt-tool-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .mt-hero { margin-top: 16px; border-radius: 22px; }
  .mt-form-grid,
  .mt-step-grid,
  .mt-detail-grid,
  .mt-faq-section .faq-grid-unique,
  .mt-tool-grid,
  .mt-info-grid { grid-template-columns: 1fr; }
  .mt-detail-card:first-child { grid-column: auto; }
  .mt-card-heading,
  .mt-result-header { align-items: flex-start; flex-direction: column; }
  .mt-live-badge { align-self: flex-start; }
  .mt-actions { display: grid; grid-template-columns: 1fr; }
  .mt-btn { width: 100%; }
  .mt-result-grid { grid-template-columns: 1fr; }
  .mt-directory-controls { grid-template-columns: 1fr; }
  .mt-directory-status { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .mt-page,
  .mt-section,
  .mt-hero,
  .mt-faq-section,
  body.math-tools-theme .related-tools { width: min(100% - 18px, 1180px); }
  .mt-calculator-card,
  .mt-reference-card { padding: 19px; border-radius: 18px; }
  .mt-trust-row { justify-content: flex-start; }
  .mt-trust-row span { width: 100%; justify-content: center; }
}
