/* ===== TOOLS PAGES - SHARED STYLES ===== */

.tools-section,
.tool-page {
  overflow-x: hidden;
}

/* ── Listing hero ── */
.tools-hero {
  position: relative;
  padding: var(--space-3xl) 0 var(--space-2xl);
  background: linear-gradient(135deg, #0d2137 0%, #1a3a5c 40%, #1B6AE5 100%);
  text-align: center;
  overflow: hidden;
}

.tools-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero_banner.jpg') center/cover no-repeat;
  opacity: 0.12;
}

.tools-hero__content {
  position: relative;
  z-index: 2;
}

.tools-hero__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.5px;
}

.tools-hero__subtitle {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.78);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Tools listing section ── */
.tools-section {
  padding: var(--space-3xl) 0 var(--space-4xl);
}

.tools-section__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
}

.tools-section__label--finance { color: var(--primary); }
.tools-section__label--fengshui { color: #b7791f; }

.tools-section__label::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
}
.tools-section__label--finance::before { background: var(--primary); }
.tools-section__label--fengshui::before { background: #b7791f; }

.tools-section__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: var(--space-xl);
}

.tools-section + .tools-section {
  padding-top: 0;
}

/* ── Tool card grid ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.tool-card {
  min-width: 0;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--dark-100);
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(27,106,229,0.3);
}

.tool-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  flex-shrink: 0;
}

.tool-card__icon--blue   { background: #e8f0fe; color: #1B6AE5; }
.tool-card__icon--green  { background: #e6f9f0; color: #00a85a; }
.tool-card__icon--orange { background: #fff4ec; color: #e07300; }
.tool-card__icon--purple { background: #f3effe; color: #7c3aed; }
.tool-card__icon--teal   { background: #e0f7f6; color: #00897b; }
.tool-card__icon--red    { background: #fdecea; color: #e03131; }

.tool-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.tool-card__desc {
  font-size: 0.875rem;
  color: var(--dark-500);
  line-height: 1.6;
  flex: 1;
  margin-bottom: var(--space-lg);
}

.tool-card__cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.tool-card__cta i {
  transition: transform var(--transition-fast);
  font-size: 1rem;
}

.tool-card:hover .tool-card__cta i {
  transform: translateX(4px);
}

/* ── Individual tool page layout ── */
.tool-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
  min-height: 60vh;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-xl);
  font-size: 0.8125rem;
  color: var(--dark-400);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--dark-400);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb__sep { color: var(--dark-300); }

.breadcrumb__current {
  color: var(--dark-600);
  font-weight: 500;
}

/* Tool page header */
.tool-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--dark-100);
}

.tool-header__body {
  min-width: 0;
}

.tool-header__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.tool-header__icon--blue   { background: #e8f0fe; color: #1B6AE5; }
.tool-header__icon--green  { background: #e6f9f0; color: #00a85a; }
.tool-header__icon--orange { background: #fff4ec; color: #e07300; }
.tool-header__icon--purple { background: #f3effe; color: #7c3aed; }
.tool-header__icon--teal   { background: #e0f7f6; color: #00897b; }
.tool-header__icon--red    { background: #fdecea; color: #e03131; }

.tool-header__body h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: 6px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tool-header__body p {
  font-size: 0.9375rem;
  color: var(--dark-500);
  line-height: 1.6;
  max-width: 600px;
}

/* Two-column layout */
.tool-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: start;
}

.tool-layout > *,
.tool-form-panel,
.tool-result-panel {
  min-width: 0;
}

/* ── Form panel ── */
.tool-form-panel {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--dark-100);
  position: sticky;
  top: 24px;
}

.panel-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--dark-800);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--dark-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title i { color: var(--primary); }

/* Form groups */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark-600);
  margin-bottom: 6px;
}

.form-label .hint {
  font-weight: 400;
  color: var(--dark-400);
}

.form-control {
  min-width: 0;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  color: var(--dark-800);
  background: var(--dark-50);
  border: 1.5px solid var(--dark-200);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: var(--font-primary);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(27,106,229,0.1);
}

.form-control::placeholder { color: var(--dark-400); }

select.form-control {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.938 10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: var(--dark-50);
  padding-right: 36px;
}

/* Range slider */
.range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.range-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 12px;
  border-radius: var(--radius-full);
}

input[type="range"] {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--dark-200);
  border-radius: var(--radius-full);
  cursor: pointer;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(27,106,229,0.4);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(27,106,229,0.4);
  cursor: pointer;
  border: none;
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 8px;
}

.radio-option {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1.5px solid var(--dark-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--dark-600);
  background: var(--dark-50);
}

.radio-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.radio-option input[type="radio"] {
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* Input with unit suffix */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .form-control {
  padding-right: 82px;
}

.input-suffix {
  position: absolute;
  right: 14px;
  max-width: 44%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dark-400);
  pointer-events: none;
  white-space: nowrap;
}

/* Unit toggle */
.unit-toggle {
  display: flex;
  border: 1.5px solid var(--dark-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.unit-btn {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark-500);
  background: var(--dark-50);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  font-family: var(--font-primary);
}

.unit-btn.active {
  background: var(--primary);
  color: var(--white);
}

/* Calc button */
.btn-calc {
  width: 100%;
  padding: 13px;
  background: var(--primary-gradient);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-primary);
  margin-top: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(27,106,229,0.3);
}

.btn-calc:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(27,106,229,0.45);
}

/* ── Result panel ── */
.tool-result-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.result-card {
  min-width: 0;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--dark-100);
}

.result-card__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--dark-500);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow-wrap: anywhere;
}

/* Stats grid */
.result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-stat {
  min-width: 0;
  padding: var(--space-md);
  background: var(--dark-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-100);
}

.result-stat--wide {
  grid-column: 1 / -1;
}

.result-stat--primary {
  background: var(--primary-light);
  border-color: rgba(27,106,229,0.15);
}

.result-stat--accent {
  background: #fff4ec;
  border-color: rgba(224,115,0,0.15);
}

.result-stat--success {
  background: #e6f9f0;
  border-color: rgba(0,168,90,0.15);
}

.result-stat--warn {
  background: #fef9e7;
  border-color: rgba(183,121,31,0.2);
}

.result-stat__label {
  font-size: 0.75rem;
  color: var(--dark-400);
  font-weight: 500;
  margin-bottom: 4px;
}

.result-stat__value {
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-weight: 700;
  color: var(--dark-900);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.result-stat--primary .result-stat__value { color: var(--primary); }
.result-stat--accent  .result-stat__value { color: #e07300; }
.result-stat--success .result-stat__value { color: #00a85a; }
.result-stat--warn    .result-stat__value { color: #b7791f; }

/* Empty state */
.result-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--dark-400);
}

.result-empty i {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
}

.result-empty p {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Tables */
.result-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-200);
}

.result-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.result-table th {
  padding: 10px 14px;
  text-align: right;
  background: var(--dark-50);
  color: var(--dark-500);
  font-weight: 600;
  border-bottom: 1px solid var(--dark-200);
  white-space: nowrap;
}

.result-table th:first-child { text-align: left; }

.result-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--dark-100);
  color: var(--dark-700);
  text-align: right;
}

.result-table td:first-child { text-align: left; font-weight: 600; }

.result-table tr:last-child td { border-bottom: none; }

.result-table tr:hover td { background: var(--dark-50); }

/* Show-more button */
.btn-show-more {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--dark-300);
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark-500);
  cursor: pointer;
  margin-top: 8px;
  transition: all var(--transition-fast);
  font-family: var(--font-primary);
}

.btn-show-more:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ── Borrowing capacity tool ── */
.borrow-tool-layout {
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
}

.form-hint {
  margin-top: -4px;
  margin-bottom: 8px;
  color: var(--dark-400);
  font-size: 0.75rem;
  line-height: 1.5;
}

.borrow-form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.borrow-field {
  min-width: 0;
}

.borrow-range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  align-items: center;
  gap: 12px;
}

.borrow-range-row--compact {
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}

.borrow-number-wrap {
  position: relative;
  min-width: 0;
}

.borrow-number-wrap .form-control {
  height: 42px;
  padding: 9px 44px 9px 10px;
  text-align: right;
  font-weight: 700;
}

.borrow-number-wrap--small .form-control {
  padding-right: 38px;
}

.borrow-number-wrap span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dark-400);
  font-size: 0.6875rem;
  font-weight: 700;
  pointer-events: none;
}

.borrow-divider {
  margin: var(--space-md) 0;
  border: 0;
  border-top: 1px solid var(--dark-100);
}

.borrow-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.borrow-loan-preview {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--dark-100);
  border-radius: var(--radius-md);
  background: var(--dark-50);
}

.borrow-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.borrow-preview-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dark-700);
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
}

.borrow-preview-head i {
  color: var(--primary);
  font-size: 1rem;
}

.borrow-preview-head strong {
  color: var(--primary);
  font-size: 1.125rem;
  font-weight: 800;
  text-align: right;
}

.borrow-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.borrow-preview-list div,
.borrow-summary-list div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.borrow-preview-list span,
.borrow-summary-list span {
  color: var(--dark-500);
  font-size: 0.8125rem;
}

.borrow-preview-list strong,
.borrow-summary-list strong {
  color: var(--dark-800);
  font-size: 0.8125rem;
  font-weight: 800;
  text-align: right;
}

.borrow-preview-list div:first-child strong {
  color: #e07300;
}

.borrow-preview-list div:last-child strong {
  color: #00a85a;
}

.borrow-loan-preview p,
.borrow-note-card p {
  margin-top: 10px;
  color: var(--dark-500);
  font-size: 0.75rem;
  line-height: 1.6;
}

.borrow-method {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-md);
}

.borrow-method > span {
  color: var(--dark-500);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.borrow-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(27,106,229,0.14);
  border-radius: var(--radius-md);
  background: var(--primary-light);
}

.borrow-segmented button {
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: calc(var(--radius-md) - 3px);
  background: transparent;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.borrow-segmented button:hover {
  background: rgba(255,255,255,0.65);
}

.borrow-segmented button.is-active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(27,106,229,0.18);
}

.borrow-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.borrow-results[hidden],
#stressCard[hidden],
#adviceCard[hidden],
#methodNote[hidden],
#stressMethodNote[hidden] {
  display: none !important;
}

.borrow-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  color: var(--white);
}

.borrow-verdict i {
  font-size: 2rem;
  flex-shrink: 0;
}

.borrow-verdict strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1rem;
  font-weight: 800;
}

.borrow-verdict p {
  color: rgba(255,255,255,0.9);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.borrow-verdict--safe { background: #16a34a; }
.borrow-verdict--acceptable { background: var(--primary); }
.borrow-verdict--warning { background: #f59e0b; }
.borrow-verdict--danger { background: #dc2626; }

.borrow-metric {
  padding: var(--space-md);
  border: 1px solid var(--dark-100);
  border-radius: var(--radius-md);
  background: var(--white);
}

.borrow-metric__head,
.borrow-stress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.borrow-metric__head span,
.borrow-stress-head span {
  color: var(--dark-700);
  font-size: 0.8125rem;
  font-weight: 700;
}

.borrow-metric__head strong,
.borrow-stress-head strong {
  font-size: 0.9375rem;
  font-weight: 800;
}

.borrow-progress {
  height: 10px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--dark-100);
}

.borrow-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width var(--transition-base);
}

.borrow-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--dark-400);
  font-size: 0.6875rem;
  font-weight: 700;
}

.borrow-scale--safe,
.is-safe { color: #16a34a !important; }

.borrow-scale--ok,
.is-acceptable { color: var(--primary) !important; }

.borrow-scale--warn,
.is-warning { color: #d97706 !important; }

.is-danger { color: #dc2626 !important; }

.borrow-progress .is-safe { background: #16a34a; }
.borrow-progress .is-acceptable { background: var(--primary); }
.borrow-progress .is-warning { background: #f59e0b; }
.borrow-progress .is-danger { background: #dc2626; }

.borrow-metric__note {
  margin-top: 8px;
  color: var(--dark-400);
  font-size: 0.75rem;
  line-height: 1.6;
}

.borrow-summary-card,
.borrow-suitable-card {
  padding: var(--space-md);
  border: 1px solid var(--dark-100);
  border-radius: var(--radius-md);
  background: var(--dark-50);
}

.borrow-summary-card h3,
.borrow-suitable-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--dark-900);
  font-size: 0.875rem;
  font-weight: 800;
}

.borrow-summary-card h3 i,
.borrow-suitable-card h3 i {
  color: var(--primary);
  font-size: 1rem;
}

.borrow-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.borrow-summary-list .is-total {
  padding-top: 8px;
  border-top: 1px solid var(--dark-200);
}

.borrow-summary-list .is-total span,
.borrow-summary-list .is-total strong {
  color: var(--dark-900);
  font-size: 0.9375rem;
}

.borrow-suitable-card {
  background: var(--primary-light);
  border-color: rgba(27,106,229,0.16);
}

.borrow-suitable-card > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.borrow-suitable-card span {
  min-width: 0;
  text-align: center;
}

.borrow-suitable-card small {
  display: block;
  color: var(--dark-500);
  font-size: 0.75rem;
  line-height: 1.4;
}

.borrow-suitable-card strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 800;
}

.borrow-suitable-card span:last-child strong {
  color: #16a34a;
}

.borrow-suitable-card p {
  margin-top: 10px;
  color: var(--dark-500);
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.6;
}

.borrow-stress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: var(--space-md);
}

.borrow-stress-grid div {
  min-width: 0;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: #fff7ed;
  border: 1px solid rgba(224,115,0,0.12);
  text-align: center;
}

.borrow-stress-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--dark-500);
  font-size: 0.75rem;
  line-height: 1.4;
}

.borrow-stress-grid strong {
  color: #e07300;
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.borrow-advice-card {
  border-left: 4px solid #f59e0b;
}

.borrow-advice-card ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.borrow-advice-card li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--dark-700);
  font-size: 0.875rem;
  line-height: 1.6;
}

.borrow-advice-card li i {
  margin-top: 3px;
  color: #d97706;
  flex-shrink: 0;
}

.borrow-note-card {
  background: #f8fafc;
}

/* ── Feng shui - direction table ── */
.direction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.direction-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-100);
}

.direction-item--good    { background: #e6f9f0; border-color: rgba(0,168,90,0.2); }
.direction-item--caution { background: #fef9e7; border-color: rgba(183,121,31,0.2); }
.direction-item--bad     { background: #fdecea; border-color: rgba(224,49,49,0.15); }

.direction-arrow {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.direction-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--dark-800);
}

.direction-fortune {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 2px;
}

.direction-item--good    .direction-fortune { color: #00a85a; }
.direction-item--caution .direction-fortune { color: #b7791f; }
.direction-item--bad     .direction-fortune { color: #e03131; }

/* ── Feng shui - year ratings ── */
.year-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.year-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-100);
  background: var(--dark-50);
}

.year-item--good    { background: #e6f9f0; border-color: rgba(0,168,90,0.2); }
.year-item--caution { background: #fef9e7; border-color: rgba(183,121,31,0.2); }
.year-item--bad     { background: #fdecea; border-color: rgba(224,49,49,0.15); }

.year-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  flex-shrink: 0;
}

.year-badge__year {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark-900);
}

.year-badge__can-chi {
  font-size: 0.7rem;
  color: var(--dark-500);
  font-weight: 500;
}

.year-item__body {
  min-width: 0;
  flex: 1;
}

.year-verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.year-verdict--good    { background: #00a85a; color: #fff; }
.year-verdict--caution { background: #b7791f; color: #fff; }
.year-verdict--bad     { background: #e03131; color: #fff; }

.year-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.year-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.year-tag--bad    { background: rgba(224,49,49,0.12); color: #c0392b; }
.year-tag--caution{ background: rgba(183,121,31,0.12); color: #b7791f; }
.year-tag--good   { background: rgba(0,168,90,0.12); color: #00875a; }

/* ── Lo Ban ruler visual ── */
.loban-ruler-wrap {
  margin: var(--space-lg) 0;
}

.loban-ruler {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 48px;
  border: 1px solid var(--dark-200);
  position: relative;
}

.loban-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: default;
  transition: opacity var(--transition-fast);
}

.loban-section--good { background: #4CAF50; color: #fff; }
.loban-section--bad  { background: #ef5350; color: #fff; }

.loban-section.highlight {
  outline: 3px solid var(--dark-900);
  outline-offset: -3px;
  position: relative;
  z-index: 1;
}

.loban-marker-wrap {
  position: relative;
  height: 20px;
  margin-top: 4px;
}

.loban-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.loban-marker__arrow {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid var(--dark-800);
}

.loban-section-labels {
  display: flex;
  margin-top: 2px;
}

.loban-section-label {
  flex: 1;
  text-align: center;
  font-size: 0.625rem;
  color: var(--dark-400);
  padding-top: 4px;
}

/* ── Lo Ban advanced tool ── */
.loban-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-xl);
  background: var(--white);
  border: 1px solid var(--dark-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.loban-tab {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--dark-600);
  font-size: 0.875rem;
  font-weight: 700;
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.loban-tab i {
  font-size: 1.125rem;
}

.loban-tab:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.loban-tab.is-active {
  color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px rgba(27,106,229,0.18);
}

.loban-purpose-grid {
  display: grid;
  gap: 8px;
}

.loban-purpose-btn {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1.5px solid var(--dark-200);
  border-radius: var(--radius-md);
  background: var(--dark-50);
  color: var(--dark-700);
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.loban-purpose-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--white);
  color: var(--dark-400);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.loban-purpose-btn span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.loban-purpose-btn:hover {
  border-color: rgba(27,106,229,0.35);
  background: var(--primary-light);
  color: var(--primary);
}

.loban-purpose-btn:hover i {
  color: var(--primary);
}

.loban-purpose-btn.is-active {
  border-color: rgba(27,106,229,0.45);
  background: var(--primary-light);
  color: var(--primary);
}

.loban-purpose-btn.is-active i {
  background: var(--white);
  color: var(--primary);
}

.loban-control-mode[hidden],
.loban-view[hidden],
.loban-result__details[hidden] {
  display: none !important;
}

.loban-control-mode {
  margin-top: var(--space-md);
}

.loban-side-info {
  display: none;
  flex-direction: column;
  gap: var(--space-md);
}

.loban-tool-layout.loban-mode-ruler .loban-control-content {
  display: none;
}

.loban-tool-layout.loban-mode-ruler .loban-side-info {
  display: flex;
}

.loban-helper {
  margin-top: 6px;
  color: var(--dark-500);
  font-size: 0.75rem;
  font-weight: 600;
}

.loban-control-note {
  padding: 12px;
  border: 1px solid var(--dark-100);
  border-radius: var(--radius-md);
  background: var(--dark-50);
  color: var(--dark-500);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.loban-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.loban-legend {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--dark-100);
  border-radius: var(--radius-md);
  background: var(--dark-50);
}

.loban-legend__title {
  margin-bottom: 10px;
  color: var(--dark-700);
  font-size: 0.8125rem;
  font-weight: 700;
}

.loban-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dark-600);
  font-size: 0.8125rem;
}

.loban-legend__row + .loban-legend__row {
  margin-top: 8px;
}

.loban-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.loban-dot--good { background: #16a34a; }
.loban-dot--bad { background: #dc2626; }

.loban-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.loban-muted {
  color: var(--dark-500);
  font-size: 0.875rem;
  line-height: 1.6;
}

.loban-summary {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid;
}

.loban-summary > div:last-child {
  min-width: 0;
}

.loban-summary__icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.loban-summary h3 {
  color: var(--dark-900);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.loban-summary p {
  color: var(--dark-600);
  font-size: 0.875rem;
}

.loban-summary--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.loban-summary--success .loban-summary__icon {
  background: #16a34a;
}

.loban-summary--warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.loban-summary--warn .loban-summary__icon {
  background: #d97706;
}

.loban-summary--bad {
  background: #fef2f2;
  border-color: #fecaca;
}

.loban-summary--bad .loban-summary__icon {
  background: #dc2626;
}

.loban-result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loban-result {
  overflow: hidden;
  border: 1.5px solid var(--dark-200);
  border-radius: var(--radius-md);
  background: var(--white);
}

.loban-result--priority {
  box-shadow: 0 0 0 2px rgba(27,106,229,0.14);
}

.loban-result--good { border-color: #bbf7d0; }
.loban-result--bad { border-color: #fecaca; }

.loban-result__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(86px, auto) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  transition: background var(--transition-fast);
}

.loban-result--good .loban-result__head { background: #f0fdf4; }
.loban-result--bad .loban-result__head { background: #fef2f2; }

.loban-result__status {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--white);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.loban-result--good .loban-result__status { background: #16a34a; }
.loban-result--bad .loban-result__status { background: #dc2626; }

.loban-result__main {
  min-width: 0;
}

.loban-result__main > span,
.loban-result__verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.loban-result__main strong,
.loban-result__verdict strong {
  color: var(--dark-900);
  font-size: 0.9375rem;
}

.loban-result__main em {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.6875rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.loban-result__main small,
.loban-result__verdict small {
  display: block;
  margin-top: 2px;
  color: var(--dark-500);
  font-size: 0.75rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.loban-result__verdict {
  min-width: 98px;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.loban-result--good .loban-result__verdict strong { color: #15803d; }
.loban-result--bad .loban-result__verdict strong { color: #b91c1c; }

.loban-result__chevron {
  color: var(--dark-400);
  font-size: 1.25rem;
}

.loban-result__details {
  padding: var(--space-md);
  border-top: 1px solid var(--dark-100);
  background: var(--white);
}

.loban-detail-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 8px 0;
  border-bottom: 1px solid var(--dark-100);
  color: var(--dark-500);
  font-size: 0.8125rem;
}

.loban-detail-row strong {
  color: var(--dark-800);
  text-align: right;
}

.loban-detail-meaning {
  margin: 12px 0;
  color: var(--dark-700);
  font-size: 0.875rem;
  line-height: 1.7;
}

.loban-advice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--dark-50);
  color: var(--dark-600);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.loban-advice i {
  color: var(--primary);
  font-size: 1rem;
  margin-top: 2px;
}

.loban-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.loban-chip {
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--dark-100);
  color: var(--dark-600);
  font-size: 0.75rem;
  font-weight: 700;
}

.loban-chip.is-active {
  background: #16a34a;
  color: var(--white);
}

.loban-result--bad .loban-chip.is-active {
  background: #dc2626;
}

.loban-virtual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.loban-ruler-input-group {
  min-width: min(100%, 210px);
}

.loban-ruler-input-label {
  display: block;
  color: var(--dark-500);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.loban-ruler-input-wrap {
  position: relative;
  max-width: 170px;
}

.loban-ruler-input {
  width: 100%;
  padding: 9px 44px 9px 12px;
  border: 1.5px solid var(--dark-200);
  border-radius: var(--radius-md);
  background: var(--dark-50);
  color: var(--dark-900);
  font-size: 1.0625rem;
  font-weight: 800;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.loban-ruler-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(27,106,229,0.1);
}

.loban-ruler-input-wrap span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dark-400);
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: none;
}

.loban-ruler-input-group small {
  display: block;
  margin-top: 5px;
  color: var(--dark-500);
  font-size: 0.75rem;
  font-weight: 700;
}

.loban-ruler-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: min(100%, 620px);
}

.loban-current-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
}

.loban-inline-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.loban-inline-legend .loban-legend__row {
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--dark-50);
  color: var(--dark-600);
  font-size: 0.75rem;
  font-weight: 700;
}

.loban-inline-legend .loban-legend__row + .loban-legend__row {
  margin-top: 0;
}

.loban-virtual-rulers {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.loban-virtual-item h3 {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 800;
}

.loban-virtual-item h3 span {
  color: var(--dark-500);
  font-size: 0.75rem;
  font-weight: 500;
}

.loban-virtual-track {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  min-height: 116px;
  border: 1px solid var(--dark-200);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.loban-is-dragging .loban-virtual-track {
  cursor: grabbing;
}

.loban-center-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 5;
  width: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 1px rgba(27,106,229,0.15);
  transform: translateX(-50%);
  pointer-events: none;
}

.loban-virtual-strip {
  position: relative;
  min-height: 116px;
}

.loban-strip {
  position: relative;
  min-height: 116px;
  background: var(--white);
}

.loban-strip__ticks,
.loban-strip__major,
.loban-strip__minor {
  position: relative;
}

.loban-strip__ticks {
  height: 30px;
  border-bottom: 1px solid var(--dark-200);
  background: var(--dark-50);
}

.loban-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--dark-200);
  color: var(--dark-500);
  font-size: 0.6875rem;
  white-space: nowrap;
}

.loban-strip__major {
  height: 48px;
}

.loban-strip__minor {
  height: 38px;
  border-top: 1px solid var(--dark-200);
}

.loban-strip__major span,
.loban-strip__minor span {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 4px;
  border-right: 1px solid var(--dark-300);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loban-strip__major span {
  color: var(--dark-700);
  font-size: 0.8125rem;
  font-weight: 800;
}

.loban-strip__minor span {
  color: var(--dark-600);
  font-size: 0.6875rem;
  font-weight: 600;
}

.loban-strip span.is-good {
  background: #dcfce7;
  color: #166534;
}

.loban-strip__minor span.is-good {
  background: #f0fdf4;
}

.loban-strip span.is-bad {
  background: #fee2e2;
  color: #991b1b;
}

.loban-strip__minor span.is-bad {
  background: #fef2f2;
}

.loban-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: var(--space-md);
}

.loban-suggestion {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 74px;
  padding: 12px;
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-md);
  background: var(--white);
  color: inherit;
  text-align: left;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.loban-suggestion:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.loban-suggestion strong {
  display: block;
  color: var(--dark-900);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.loban-suggestion em {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: #16a34a;
  color: var(--white);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
}

.loban-suggestion small {
  display: block;
  color: var(--dark-500);
  font-size: 0.75rem;
  margin-top: 2px;
}

.loban-suggestion > span:last-child {
  text-align: right;
}

.loban-note {
  display: flex;
  gap: 12px;
  padding: var(--space-md);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  background: #fffbeb;
  color: #92400e;
}

.loban-note i {
  font-size: 1.25rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.loban-note strong {
  display: block;
  margin-bottom: 2px;
  color: #78350f;
  font-size: 0.875rem;
}

.loban-note p {
  font-size: 0.8125rem;
  line-height: 1.7;
}

.loban-scale-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.loban-side-info .loban-scale-info {
  grid-template-columns: 1fr;
}

.loban-scale-card {
  padding: var(--space-md);
  border: 1px solid var(--dark-100);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.loban-scale-card i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.2rem;
}

.loban-scale-card h3 {
  color: var(--dark-900);
  font-size: 0.9375rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.loban-scale-card p {
  color: var(--dark-600);
  font-size: 0.8125rem;
  line-height: 1.7;
}

/* ── Rent vs Buy comparison bars ── */
.compare-bar-wrap {
  margin-bottom: 12px;
}

.compare-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark-700);
  margin-bottom: 5px;
}

.compare-bar-bg {
  background: var(--dark-100);
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
}

.compare-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.compare-bar-fill--buy  { background: var(--primary-gradient); }
.compare-bar-fill--rent { background: linear-gradient(90deg, #e07300, #ff8c42); }

/* ── Recommendation badge ── */
.recommendation {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid;
}

.recommendation > * {
  min-width: 0;
}

.recommendation--buy  { background: #e8f0fe; border-color: rgba(27,106,229,0.2); }
.recommendation--rent { background: #fff4ec; border-color: rgba(224,115,0,0.2); }
.recommendation--neutral { background: var(--dark-50); border-color: var(--dark-200); }

.recommendation__icon { font-size: 1.75rem; flex-shrink: 0; }
.recommendation__title { font-size: 1rem; font-weight: 700; color: var(--dark-900); margin-bottom: 4px; }
.recommendation__desc  { font-size: 0.875rem; color: var(--dark-600); line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 1180px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .tool-form-panel {
    position: static;
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loban-scale-info {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tools-hero {
    padding: var(--space-2xl) 0;
  }

  .tool-page {
    padding: var(--space-xl) 0 var(--space-3xl);
  }

  .tool-header,
  .tool-form-panel,
  .result-card {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
  }

  .tool-header {
    margin-bottom: var(--space-xl);
  }

  .tool-header__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
  }

  .result-table {
    min-width: 580px;
  }

  .loban-result__head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-start;
  }

  .loban-result__verdict {
    grid-column: 2 / -1;
    align-items: flex-start;
  }

  .loban-result__chevron {
    grid-column: 3;
    grid-row: 1;
  }

  .loban-tabs {
    gap: 6px;
  }

  .loban-tab {
    padding: 9px 10px;
    font-size: 0.8125rem;
  }

  .loban-tool-layout.loban-mode-ruler .tool-result-panel {
    order: 1;
  }

  .loban-tool-layout.loban-mode-ruler .loban-control-panel {
    order: 2;
  }

  .loban-ruler-tools {
    justify-content: flex-start;
  }

  .borrow-method {
    align-items: flex-start;
    flex-direction: column;
  }

  .borrow-segmented {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .tools-hero {
    padding: var(--space-xl) 0;
  }

  .tools-hero__title { font-size: 1.75rem; }

  .tools-hero__subtitle {
    font-size: 0.9375rem;
  }

  .tools-section {
    padding: var(--space-2xl) 0 var(--space-3xl);
  }

  .tools-section__title {
    font-size: 1.1875rem;
    margin-bottom: var(--space-lg);
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .tool-card {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
  }

  .tool-header {
    padding: var(--space-md);
    gap: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .tool-header__icon {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }

  .tool-header__body h1 {
    font-size: 1.25rem;
  }

  .tool-header__body p {
    font-size: 0.875rem;
  }

  .tool-form-panel,
  .result-card {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .panel-title,
  .result-card__title {
    margin-bottom: var(--space-md);
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .result-stat {
    padding: 12px;
  }

  .result-empty {
    padding: 42px 12px;
  }

  .borrow-rate-grid,
  .borrow-stress-grid,
  .borrow-suitable-card > div {
    grid-template-columns: 1fr;
  }

  .borrow-stress-grid div {
    text-align: left;
  }

  .direction-grid {
    grid-template-columns: 1fr;
  }

  .year-item,
  .recommendation {
    gap: 12px;
    padding: 12px;
  }

  .compare-label {
    font-size: 0.75rem;
  }

  .result-table {
    min-width: 540px;
    font-size: 0.75rem;
  }

  .result-table th,
  .result-table td {
    padding: 8px 10px;
  }

  .loban-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    margin-bottom: var(--space-lg);
  }

  .loban-tab {
    justify-content: center;
    min-height: 48px;
    padding: 8px 6px;
    text-align: center;
    line-height: 1.25;
    white-space: normal;
  }

  .loban-tab i {
    font-size: 1rem;
    flex-shrink: 0;
  }

  .loban-tab span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .loban-purpose-btn {
    min-height: 50px;
    padding: 9px 10px;
  }

  .loban-virtual-head {
    gap: 12px;
  }

  .loban-ruler-input-group,
  .loban-ruler-input-wrap {
    max-width: none;
    width: 100%;
  }

  .loban-range-grid,
  .loban-suggestion-grid {
    grid-template-columns: 1fr;
  }

  .loban-detail-row {
    flex-direction: column;
    gap: 2px;
  }

  .loban-detail-row strong {
    text-align: left;
  }

  .loban-summary {
    align-items: flex-start;
    padding: 12px;
  }

  .loban-summary__icon {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }

  .loban-suggestion {
    min-height: auto;
  }
}

@media (max-width: 430px) {
  .tool-header {
    flex-direction: column;
  }

  .radio-group {
    flex-direction: column;
  }

  .input-wrap .form-control {
    padding-right: 72px;
  }

  .input-suffix {
    right: 12px;
    max-width: 40%;
    font-size: 0.6875rem;
  }

  .borrow-range-row,
  .borrow-range-row--compact {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 10px;
  }

  .borrow-number-wrap .form-control {
    padding-right: 38px;
  }

  .borrow-preview-head,
  .borrow-preview-list div,
  .borrow-summary-list div,
  .borrow-metric__head,
  .borrow-stress-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .borrow-preview-head strong,
  .borrow-preview-list strong,
  .borrow-summary-list strong {
    text-align: left;
  }

  .loban-tab {
    flex-direction: column;
    gap: 4px;
    min-height: 58px;
    font-size: 0.75rem;
  }

  .year-item {
    flex-direction: column;
  }

  .year-badge {
    align-items: flex-start;
    min-width: 0;
  }

  .loban-result__head {
    gap: 10px;
    padding: 12px;
  }

  .loban-result__status {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .loban-result__main > span {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (hover: none) {
  .tool-card:hover,
  .btn-calc:hover,
  .loban-suggestion:hover {
    transform: none;
  }
}
