/* Sinaslist Tools — calculator layout, extends style.css */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

.tools-shell-hero,
.tool-section,
.tool-section-head,
.tool-row,
.tool-row p,
.tools-console-val,
.tools-text-link,
.tool-row .view-btn {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tools-shell-hero h1,
.tool-section-head h2,
.tool-row-meta h3 {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tools-shell-hero {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.24), transparent 37%),
    radial-gradient(circle at 85% 18%, rgba(96, 165, 250, 0.2), transparent 31%),
    linear-gradient(180deg, rgba(244, 249, 255, 0.98), rgba(232, 241, 255, 0.98)),
    linear-gradient(135deg, #f5f9ff, #e9f2ff);
  color: #0f172a;
}

.tools-shell-hero .container {
  max-width: 1120px;
}

.site-header {
  background: rgba(248, 251, 255, 0.92);
  border-bottom: 1px solid #d7e3f7;
  backdrop-filter: blur(8px);
}

.site-header .container {
  gap: 1.5rem;
}

.logo {
  color: #0f172a;
}

.logo span {
  color: #2563eb;
}

nav a {
  color: #334155;
}

nav a:hover,
nav a.active {
  background: #e7f0ff;
  color: #1d4ed8;
}

.tools-topbar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.tools-topbar-stat {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  color: #475569;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .45rem .65rem;
  border: 1px solid #d7e3f7;
  border-radius: 999px;
  background: #f5f9ff;
}

.tools-topbar-stat strong {
  color: #0f172a;
  font-weight: 700;
}

.tools-landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 2rem;
  align-items: stretch;
}

.tools-landing-copy h1 {
  max-width: 9ch;
  margin-bottom: 1rem;
  color: #0f172a;
  font-size: clamp(1.95rem, 4vw, 3.55rem);
  line-height: 1.01;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.tools-kicker,
.tool-section-label,
.tool-tag {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tools-kicker { color: #2563eb; }
.tool-section-label { color: #1d4ed8; }

.tools-kicker { margin-bottom: .55rem; }

.tools-hero-actions {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.35rem;
}

.tools-primary-btn {
  background: #eef5ff;
  color: #1d4ed8;
  border: 1px solid #d7e3f7;
  padding: .52rem .85rem;
  border-radius: 999px;
  font-weight: 600;
}

.tools-primary-btn:hover {
  background: #e6f1ff;
}

.tools-text-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
}

.tools-text-link:hover {
  color: #1d4ed8;
}

.tools-console {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #d7e3f7;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.tools-console-bar {
  display: flex;
  align-items: center;
  gap: .42rem;
  padding: .7rem .95rem;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
}

.tools-console-bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.tools-console-bar p {
  margin-left: .4rem;
}

.tools-console-body {
  padding: 1rem .95rem 1.05rem;
}

.tools-console-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: .9rem;
  padding: .72rem 0;
  border-top: 1px solid #edf2f7;
}

.tools-console-row:first-child {
  padding-top: 0;
  border-top: none;
}

.tools-console-key {
  color: #2563eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tools-console-val {
  color: #334155;
  line-height: 1.5;
  font-size: .92rem;
}

.hero-sub {
  max-width: 38rem;
  color: #334155;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.72;
}

.tool-section {
  padding: 2.85rem 0 1rem;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 26%);
}

.tool-section + .tool-section {
  padding-top: 3.6rem;
  border-top: 1px solid #dbe3f0;
}

.tool-section-head {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr);
  gap: 1.9rem;
  margin-bottom: 1.8rem;
  align-items: start;
}

.tool-section-head h2 {
  color: #0f172a;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  line-height: 1.08;
  font-weight: 800;
}

.tool-section-head p:last-child {
  color: #475569;
  line-height: 1.72;
  max-width: 42rem;
}

.tool-ledger {
  border-top: 1px solid #dbe3f0;
}

.tool-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.35rem 0;
  border-bottom: 1px solid #dbe3f0;
}

.tool-row-featured {
  align-items: start;
}

.tool-row-meta h3 {
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 700;
}

.tool-row-meta h3 a {
  color: #0f172a;
  text-decoration: none;
}

.tool-row-meta h3 a:hover {
  color: #1d4ed8;
}

.tool-tag {
  display: inline-block;
  margin-bottom: .35rem;
  color: #64748b;
}

.tool-row p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
  font-size: .9rem;
}

.tool-row .view-btn {
  background: #f5f9ff;
  color: #1d4ed8;
  border: 1px solid #d7e3f7;
  border-radius: 999px;
  padding: .42rem .78rem;
}

.tool-row .view-btn:hover {
  background: #edf5ff;
}

.tools-footer {
  margin-top: 2.4rem;
  padding: 1.25rem 0 2rem;
  border-top: 1px solid #d7e3f7;
  background:
    linear-gradient(180deg, rgba(241, 247, 255, 0.86), rgba(232, 241, 255, 0.96));
}

.tools-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.1rem;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: .9rem;
}

.tools-footer-inner p {
  margin: 0;
}

.tools-footer a {
  color: #2563eb;
  text-decoration: none;
}

.tools-footer a:hover {
  color: #1d4ed8;
}

.tools-footer span {
  color: #94a3b8;
  margin: 0 .3rem;
}

.tools-hero { text-align: left; }
.tool-breadcrumb { font-size: .82rem; opacity: .85; margin-bottom: .5rem; }
.tool-breadcrumb a { color: #fff; }

.calc-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
  align-items: start;
}

.inputs-card h2, .summary-card h2 { color: var(--primary); margin-bottom: 1.25rem; }

.inputs-card,
.summary-card,
.compare-card,
details {
  border-radius: 12px;
}

.inputs-card {
  position: sticky;
  top: 1.25rem;
}

.loan-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.loan-tab { flex: 1; padding: .45rem .55rem; border: 1.5px solid var(--border); border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 700; cursor: pointer; color: var(--muted); transition: all .15s; white-space: nowrap; }
.loan-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.loan-desc { font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.5; }

.addon-list { display: flex; flex-direction: column; gap: .5rem; }
.addon-item { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text); font-weight: 500; cursor: pointer; }
.addon-item input { width: auto; accent-color: var(--primary); }

.field-group { margin-bottom: .875rem; }
.field-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.optional { font-weight: 400; font-size: .75rem; }
.field-group input, .field-group select { width: 100%; padding: .55rem .75rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: .95rem; color: var(--text); transition: border-color .15s; }
.field-group input:focus, .field-group select:focus { outline: none; border-color: var(--primary); }
.hint { font-size: .75rem; color: var(--muted); margin-top: .2rem; display: block; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.term-row { display: flex; gap: .5rem; }
.term-row input { flex: 1; }
.term-row select { width: 110px; }

.results-col { display: flex; flex-direction: column; }
.summary-card { border-top: 4px solid var(--primary); }
.monthly-amount { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; color: var(--primary); margin-bottom: .15rem; }
.monthly-sub { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }

.affordability { padding: .5rem .75rem; border-radius: 6px; margin-bottom: 1rem; font-size: .85rem; font-weight: 600; }
.afford-ok   { background: #d1fae5; color: #065f46; }
.afford-warn { background: #fef3c7; color: #92400e; }
.afford-bad  { background: #fee2e2; color: #991b1b; }

.result-pills { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pill { flex: 1; min-width: 90px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; text-align: center; }
.interest-pill { background: #fff4f4; border-color: #fecaca; }
.fee-pill { background: #fbfbfb; border-color: var(--border); }
.pill-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pill-val { font-size: 1rem; font-weight: 800; color: var(--primary); margin-top: .15rem; }
.interest-pill .pill-val { color: #b91c1c; }

.stack-bar-wrap { margin: .5rem 0 1rem; }
.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: .4rem; }
.bar-principal { background: var(--primary); transition: width .3s; }
.bar-interest  { background: #dc2626; transition: width .3s; }
.bar-legend { display: flex; gap: 1rem; font-size: .75rem; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.dot-principal { background: var(--primary); }
.dot-interest  { background: #dc2626; }

.breakdown { border-top: 1px solid var(--border); padding-top: .75rem; }
.breakdown-row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .88rem; border-bottom: 1px dashed var(--border); }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row.highlight { font-weight: 700; font-size: 1rem; }
.red { color: #dc2626; font-weight: 600; }

.content-section { margin: 3rem 0; }
.content-section h2 { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--primary); color: #fff; padding: .6rem 1rem; text-align: right; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table th:first-child { text-align: left; }
.data-table td { padding: .55rem 1rem; border-bottom: 1px solid var(--border); text-align: right; }
.data-table td:first-child { text-align: left; font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: #f0f7ff; }
.table-note { font-size: .8rem; color: var(--muted); margin-top: .75rem; }

.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.compare-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.compare-card h3 { font-size: .95rem; font-weight: 700; color: var(--primary); margin-bottom: .4rem; }
.compare-card p { font-size: .875rem; color: var(--muted); line-height: 1.6; }

.faq-list { display: flex; flex-direction: column; gap: .75rem; }
details { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
summary { font-weight: 600; cursor: pointer; font-size: .95rem; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: '+ '; color: var(--primary); font-weight: 800; }
details[open] summary::before { content: '\2212 '; }
details p { margin-top: .6rem; font-size: .875rem; color: var(--muted); line-height: 1.7; }

.checkbox-group label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 500; color: var(--text); cursor: pointer; }
.checkbox-group input { width: auto; accent-color: var(--primary); }
.checkbox-group .hint { display: inline; margin: 0 0 0 .3rem; }

.breakdown-row.gross { font-weight: 700; }
.breakdown-row.neutral { color: var(--muted); font-style: italic; }
.breakdown-row.net { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--border); padding-top: .5rem; margin-top: .25rem; }

.effective-rate { text-align: center; font-size: .85rem; color: var(--muted); margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--border); }

.employer-card { margin-top: 1.25rem; border-top: 4px solid var(--primary-dk); }
.employer-card h3 { color: var(--primary); margin-bottom: 1rem; font-size: 1rem; }
.itf-note { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

@media (max-width: 900px) {
  .tools-topbar {
    margin-bottom: .95rem;
  }

  .tools-landing-hero,
  .tool-section-head,
  .tool-row,
  .calc-layout {
    grid-template-columns: 1fr;
  }

  .tool-row {
    gap: .7rem;
    align-items: start;
  }

  .inputs-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .tools-hero-actions,
  .tools-topbar {
    align-items: stretch;
  }

  .tools-topbar-stat,
  .tools-primary-btn {
    width: 100%;
    text-align: center;
  }

  .tools-console-row {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  .tools-footer-inner {
    justify-content: flex-start;
  }
}

/* ── Crypto transaction list ────────────────────────────────────────────────── */

.tx-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
  padding: .5rem .75rem;
  background: var(--card-bg, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: .5rem;
  flex-wrap: wrap;
}

.tx-type {
  flex: 0 0 auto;
  min-width: 70px;
  padding: .4rem .5rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: .375rem;
  font-size: .85rem;
  background: #fff;
  color: #0f172a;
}

.tx-type option[value="buy"] {
  color: #16a34a;
}

.tx-type option[value="sell"] {
  color: #dc2626;
}

.tx-date {
  flex: 0 0 140px;
  padding: .4rem .5rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: .375rem;
  font-size: .85rem;
  background: #fff;
  color: #0f172a;
}

.tx-amount,
.tx-price,
.tx-fee {
  flex: 1;
  min-width: 90px;
  padding: .4rem .5rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: .375rem;
  font-size: .85rem;
  background: #fff;
  color: #0f172a;
}

.tx-remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: .375rem;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  font-size: .8rem;
  transition: all .15s;
}

.tx-remove:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-add-tx {
  display: inline-flex;
  align-items: center;
  padding: .45rem 1rem;
  border: 1px dashed var(--primary, #3730a3);
  border-radius: .375rem;
  background: transparent;
  color: var(--primary, #3730a3);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.btn-add-tx:hover {
  background: rgba(55, 48, 163, .06);
}

@media (max-width: 640px) {
  .tx-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tx-type,
  .tx-date,
  .tx-amount,
  .tx-price,
  .tx-fee {
    flex: 1 1 auto;
    min-width: unset;
    width: 100%;
  }

  .tx-remove {
    align-self: flex-end;
  }
}

/* Hide single-disposal fields in crypto mode via JS — fallback: field-group[data-crypto-hidden] */
.field-group[data-crypto-hidden] {
  display: none;
}
