/* ============================================
   UNIT CONVERTER — page styles
   Accent: violet / purple (#a78bfa dark / #7c3aed light) — Converters category
   ============================================ */

/* ---- Page wrapper ---- */
.calc-page {
  position: relative; z-index: 1;
  max-width: 1380px; margin: 0 auto;
  padding: 48px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 520px;
  grid-template-rows: auto auto;
  gap: 48px; align-items: start;
}
.calc-page-info {
  position: static;
}

/* ---- Breadcrumb ---- */
.calc-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); margin-bottom: 20px; flex-wrap: wrap;
}
.calc-breadcrumb a { color: var(--text-dim); transition: color var(--transition); }
.calc-breadcrumb a:hover { color: #a78bfa; }
body.light-theme .calc-breadcrumb a:hover { color: #7c3aed; }
.calc-breadcrumb i { font-size: 10px; }

/* ---- Category tag ---- */
.calc-page-tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 8px;
  background: rgba(167,139,250,0.10); border: 1px solid rgba(167,139,250,0.26);
  border-radius: 100px; font-size: 12px; font-weight: 600; color: #a78bfa;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 18px;
}
body.light-theme .calc-page-tag {
  background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.20); color: #7c3aed;
}

/* ---- Title ---- */
.calc-page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(28px, 3.2vw, 44px); font-weight: 800;
  line-height: 1.1; letter-spacing: -1.5px; color: var(--text); margin-bottom: 16px;
}
.calc-page-title span { color: #a78bfa; }
body.light-theme .calc-page-title span { color: #7c3aed; }
.calc-page-desc { font-size: 16px; line-height: 1.75; color: var(--text-muted); margin-bottom: 32px; }

/* ---- Feature pills ---- */
.calc-features { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.calc-feature-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.calc-feature-pill i { color: #a78bfa; font-size: 12px; }
body.light-theme .calc-feature-pill i { color: #7c3aed; }

/* ============================================
   QUICK REFERENCE CARDS (left column)
   ============================================ */
.uc-ref-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px;
}
.uc-ref-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.uc-ref-card:hover { border-color: rgba(167,139,250,0.40); box-shadow: 0 0 0 1px rgba(167,139,250,0.14); }
body.light-theme .uc-ref-card:hover { border-color: rgba(124,58,237,0.34); box-shadow: 0 0 0 1px rgba(124,58,237,0.10); }
.uc-ref-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--bg-3); border-bottom: 1px solid var(--border);
}
.uc-ref-icon { font-size: 13px; color: #a78bfa; }
body.light-theme .uc-ref-icon { color: #7c3aed; }
.uc-ref-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.uc-ref-rows { padding: 8px 0; }
.uc-ref-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 14px; font-size: 12px; color: var(--text-muted); line-height: 1.4;
  border-bottom: 1px solid var(--border);
}
.uc-ref-row:last-child { border-bottom: none; }
.uc-ref-eq { font-family: 'DM Mono', monospace; font-size: 11px; color: #a78bfa; font-weight: 600; }
body.light-theme .uc-ref-eq { color: #7c3aed; }

/* ---- Content blocks ---- */
.calc-page-content {
  margin-top: 0;
  min-width: 0;
}

.calc-page-content.fade-up {
  opacity: 1;
  transform: none;
  animation: none;
  transition: none;
  visibility: visible;
}
.content-block { margin-bottom: 44px; }
.content-block h2 {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px; color: var(--text); margin-bottom: 14px;
}
.content-block p { font-size: 15px; line-height: 1.8; color: var(--text-muted); margin-bottom: 10px; }
.content-block strong { color: var(--text); font-weight: 600; }
.content-block em { font-style: italic; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-item:hover { border-color: var(--border-hover); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: transparent; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600;
  color: var(--text); text-align: left; transition: color var(--transition);
}
.faq-question:hover { color: #a78bfa; }
body.light-theme .faq-question:hover { color: #7c3aed; }
.faq-question i { font-size: 12px; color: var(--text-dim); flex-shrink: 0; transition: transform var(--transition), color var(--transition); }
.faq-item.open .faq-question i { transform: rotate(180deg); color: #a78bfa; }
body.light-theme .faq-item.open .faq-question i { color: #7c3aed; }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  font-size: 14px; line-height: 1.75; color: var(--text-muted); padding: 0 18px;
}
.faq-item.open .faq-answer { max-height: 300px; padding: 0 18px 16px; }

/* Also search */
.also-search-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.also-search-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 100px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.also-search-chip:hover { background: rgba(167,139,250,0.08); border-color: #a78bfa; color: #a78bfa; }
body.light-theme .also-search-chip:hover { background: rgba(124,58,237,0.06); border-color: #7c3aed; color: #7c3aed; }
.also-search-chip i { color: #a78bfa; font-size: 12px; }
body.light-theme .also-search-chip i { color: #7c3aed; }

/* ============================================
   CALC CARD
   ============================================ */
.calc-panel { position: sticky; top: calc(var(--header-h, 68px) + 24px); }
.calc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(167,139,250,0.06);
}
.calc-card-header {
  padding: 20px 24px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  display: none; align-items: center; gap: 12px;
}
@media (max-width: 1024px) { .calc-card-header { display: flex; } }
.calc-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(167,139,250,0.10); border: 1px solid rgba(167,139,250,0.26);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #a78bfa; flex-shrink: 0;
}
body.light-theme .calc-card-icon { background: rgba(124,58,237,0.07); border-color: rgba(124,58,237,0.22); color: #7c3aed; }
.calc-card-header-text h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.calc-card-header-text p  { font-size: 12px; color: var(--text-dim); }
.calc-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }

/* ============================================
   9-CATEGORY TAB STRIP
   ============================================ */
.uc-tab-strip {
  display: grid; grid-template-columns: repeat(9, 1fr);
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px; gap: 2px;
  overflow: hidden;
}
.uc-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 2px; border: none; background: transparent;
  border-radius: 6px; cursor: pointer; outline: none;
  font-family: 'DM Sans', sans-serif; font-size: 9px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.uc-tab i { font-size: 13px; }
.uc-tab:hover:not(.active) { background: var(--bg-2); color: var(--text-muted); }
.uc-tab.active {
  background: var(--surface); color: #a78bfa;
  box-shadow: 0 1px 6px rgba(0,0,0,0.18), 0 0 0 1px rgba(167,139,250,0.22);
}
body.light-theme .uc-tab.active { color: #7c3aed; box-shadow: 0 1px 6px rgba(0,0,0,0.12), 0 0 0 1px rgba(124,58,237,0.18); }

/* ============================================
   BINARY TOGGLE ROW
   ============================================ */
.uc-binary-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 8px; margin-top: -4px;
}
.uc-binary-label {
  font-size: 12px; font-weight: 600; color: var(--text-muted); flex: 1;
}
.uc-binary-hint {
  font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 600;
  color: #a78bfa; min-width: 90px; text-align: right;
}
body.light-theme .uc-binary-hint { color: #7c3aed; }

/* Toggle pill switch */
.uc-toggle {
  position: relative; width: 44px; height: 24px; border-radius: 100px;
  background: var(--border); border: none; cursor: pointer; outline: none;
  transition: background 0.25s ease; flex-shrink: 0;
}
.uc-toggle[aria-checked="true"] { background: #a78bfa; }
body.light-theme .uc-toggle[aria-checked="true"] { background: #7c3aed; }
.uc-toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.uc-toggle[aria-checked="true"] .uc-toggle-knob { transform: translateX(20px); }

/* ============================================
   INPUT ROW (value + unit select side by side)
   ============================================ */
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.form-label i { color: #a78bfa; font-size: 11px; }
body.light-theme .form-label i { color: #7c3aed; }

.uc-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-input {
  width: 100%; padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
  -moz-appearance: textfield; appearance: none;
}
.form-input::-webkit-outer-spin-button, .form-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.form-input:hover { border-color: var(--border-hover); }
.form-input:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,0.15); }
body.light-theme .form-input:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.10); }
.uc-val-input {
  font-family: 'Bricolage Grotesque', sans-serif !important;
  font-size: 17px !important; font-weight: 700 !important;
}
.uc-unit-select { appearance: auto; cursor: pointer; font-size: 13px !important; padding: 10px 8px !important; }

/* ============================================
   SWAP BUTTON
   ============================================ */
.uc-swap-row {
  display: flex; align-items: center; justify-content: center; gap: 0; padding: 6px 0;
}
.uc-swap-line { flex: 1; height: 1px; background: var(--border); margin: 0 12px; }
.uc-swap-btn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(167,139,250,0.10); border: 1px solid rgba(167,139,250,0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #a78bfa; cursor: pointer; outline: none;
  transition: background var(--transition), box-shadow var(--transition), transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
body.light-theme .uc-swap-btn { background: rgba(124,58,237,0.07); border-color: rgba(124,58,237,0.24); color: #7c3aed; }
.uc-swap-btn:hover {
  background: #a78bfa; color: #fff;
  box-shadow: 0 2px 14px rgba(167,139,250,0.45);
}
body.light-theme .uc-swap-btn:hover { background: #7c3aed; color: #fff; }
.uc-swap-btn.swapped { transform: rotate(180deg); }
.uc-swap-btn:active { transform: scale(0.88); }
.uc-swap-btn.swapped:active { transform: rotate(180deg) scale(0.88); }

/* ============================================
   RESET + ERROR
   ============================================ */
.uc-clear-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 9px 16px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.uc-clear-btn:hover { background: var(--bg-3); border-color: var(--border-hover); color: var(--text); }

.calc-error {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: rgba(251,113,133,0.08); border: 1px solid rgba(251,113,133,0.28);
  border-radius: var(--radius-sm); color: #fb7185;
  font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none;
}
body.light-theme .calc-error { color: #e11d48; background: rgba(225,29,72,0.07); border-color: rgba(225,29,72,0.26); }
.calc-error.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ============================================
   ALL-UNITS OUTPUT PANEL
   ============================================ */
.uc-all-panel {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.uc-all-panel.show { opacity: 1; transform: translateY(0); }
.uc-all-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--bg-3); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #a78bfa;
}
body.light-theme .uc-all-header { color: #7c3aed; }
.uc-all-header i { font-size: 12px; }
.uc-all-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.uc-all-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.uc-all-item:nth-child(odd) { border-right: 1px solid var(--border); }
.uc-all-item:hover { background: var(--bg-3); }
.uc-all-item.highlight {
  background: rgba(167,139,250,0.08); border-right-color: var(--border);
}
body.light-theme .uc-all-item.highlight { background: rgba(124,58,237,0.05); }
/* Remove bottom border from last two items */
.uc-all-item:nth-last-child(-n+2) { border-bottom: none; }

.uc-all-unit { font-size: 12px; font-weight: 500; color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-all-val  {
  font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 700;
  color: var(--text); text-align: right; flex-shrink: 0; max-width: 55%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uc-all-item.highlight .uc-all-val { color: #a78bfa; }
body.light-theme .uc-all-item.highlight .uc-all-val { color: #7c3aed; }

/* Result note */
.result-note {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11px; color: var(--text-dim); line-height: 1.6;
}
.result-note i { color: #a78bfa; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
body.light-theme .result-note i { color: #7c3aed; }

/* ============================================
   TOPIC CLUSTER
   ============================================ */
.topic-cluster-section {
  position: relative; z-index: 1; background: var(--bg-2);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.topic-cluster-inner { max-width: 1380px; margin: 0 auto; padding: 56px 24px; }
.topic-cluster-header { max-width: 680px; margin-bottom: 40px; }
.topic-cluster-tag {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 8px;
  background: rgba(167,139,250,0.10); border: 1px solid rgba(167,139,250,0.24);
  border-radius: 100px; font-size: 12px; font-weight: 600; color: #a78bfa;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px;
}
body.light-theme .topic-cluster-tag { background: rgba(124,58,237,0.07); border-color: rgba(124,58,237,0.20); color: #7c3aed; }
.topic-cluster-header h2 {
  font-family: 'Bricolage Grotesque', sans-serif; font-size: clamp(22px,2.5vw,30px);
  font-weight: 800; letter-spacing: -0.8px; color: var(--text); margin-bottom: 12px;
}
.topic-cluster-header p { font-size: 15px; line-height: 1.75; color: var(--text-muted); }

.cluster-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; margin-bottom: 40px; align-items: start; }
.cluster-primary { background: var(--surface); border: 2px solid #a78bfa; border-radius: var(--radius); padding: 22px; position: relative; }
body.light-theme .cluster-primary { border-color: #7c3aed; }
.cluster-primary::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(135deg, rgba(167,139,250,0.07) 0%, transparent 60%); pointer-events: none; }
.cluster-primary-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #a78bfa; margin-bottom: 10px; }
body.light-theme .cluster-primary-label { color: #7c3aed; }
.cluster-primary h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; position: relative; }
.cluster-primary p  { font-size: 13px; line-height: 1.65; color: var(--text-muted); margin-bottom: 14px; position: relative; }
.cluster-keywords { display: flex; flex-wrap: wrap; gap: 6px; position: relative; }
.cluster-keywords span { padding: 3px 9px; background: rgba(167,139,250,0.10); border: 1px solid rgba(167,139,250,0.22); border-radius: 100px; font-size: 11px; font-weight: 600; color: #a78bfa; }
body.light-theme .cluster-keywords span { background: rgba(124,58,237,0.07); border-color: rgba(124,58,237,0.18); color: #7c3aed; }

.cluster-links { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cluster-links h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--bg-3); }
.cluster-link-list { display: flex; flex-direction: column; }
.cluster-link-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.cluster-link-item:last-child { border-bottom: none; }
.cluster-link-item:hover { background: var(--bg-3); }
.cluster-link-icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px; background: rgba(167,139,250,0.09); display: flex; align-items: center; justify-content: center; font-size: 15px; color: #a78bfa; }
body.light-theme .cluster-link-icon { background: rgba(124,58,237,0.07); color: #7c3aed; }
.cluster-link-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cluster-link-text strong { font-size: 14px; font-weight: 600; color: var(--text); }
.cluster-link-text span   { font-size: 12px; color: var(--text-dim); }
.cluster-link-arrow { color: var(--text-dim); font-size: 12px; transition: transform var(--transition), color var(--transition); }
.cluster-link-item:hover .cluster-link-arrow { transform: translateX(3px); color: #a78bfa; }
body.light-theme .cluster-link-item:hover .cluster-link-arrow { color: #7c3aed; }
.cluster-link-all { background: var(--bg-2); }

.cluster-crosslinks { padding-top: 32px; border-top: 1px solid var(--border); }
.cluster-crosslinks h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); margin-bottom: 6px; }
.cluster-crosslinks > p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.crosslink-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.crosslink-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); }
.crosslink-card:hover { border-color: #a78bfa; transform: translateY(-3px); box-shadow: var(--shadow); }
body.light-theme .crosslink-card:hover { border-color: #7c3aed; }
.crosslink-card i { font-size: 20px; color: #a78bfa; }
body.light-theme .crosslink-card i { color: #7c3aed; }
.crosslink-card strong { font-family: 'Bricolage Grotesque', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); }
.crosslink-card span { font-size: 12px; line-height: 1.5; color: var(--text-dim); }

/* Ad + fade */
.ad-slot { position: relative; z-index: 1; max-width: 1380px; margin: 0 auto; padding: 0 24px 40px; }
.ad-slot > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fade-up { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .calc-page { grid-template-columns: 1fr; padding: 32px 20px 60px; gap: 32px; }
  .calc-page-info { position: static; }
  .calc-panel { position: static; order: 2; }
  .calc-page-content { order: 3; }
  .calc-card-header { display: flex !important; }
  .cluster-grid { grid-template-columns: 1fr; }
  .crosslink-grid { grid-template-columns: 1fr 1fr; }
  .uc-ref-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .uc-tab-strip { grid-template-columns: repeat(5, 1fr); }
  .uc-tab:nth-child(n+6) { display: none; } /* hide last 4 tabs — show them via scroll or second row */
}
@media (max-width: 640px) {
  .calc-page { padding: 24px 16px 48px; }
  .crosslink-grid { grid-template-columns: 1fr; }
  .topic-cluster-inner { padding: 36px 16px; }
  .uc-ref-grid { grid-template-columns: 1fr; }
  .uc-input-row { grid-template-columns: 1fr; gap: 6px; }
  .uc-all-grid { grid-template-columns: 1fr; }
  .uc-all-item:nth-child(odd) { border-right: none; }
  .uc-all-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .uc-all-item:last-child { border-bottom: none; }
  .uc-tab-strip { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 400px) {
  .uc-tab-strip { grid-template-columns: repeat(3, 1fr); }
  .uc-tab:nth-child(n+4) { display: none; }
}

@media (min-width: 1025px) {
  .calc-page-info {
    grid-row: 1 / 2;
    grid-column: 1 / 2;
  }
  .calc-page-content {
    grid-row: 2 / 3;
    grid-column: 1 / 2;
  }
  .calc-panel {
    grid-row: 1 / 3;
    grid-column: 2 / 3;
    align-self: start;
    position: sticky;
    top: calc(var(--header-h, 68px) + 24px);
  }
}

/* Read-only TO value field */
#ucToVal[readonly] {
  background: var(--bg-3);
  color: var(--text);
  cursor: default;
  opacity: 1;
}

