:root{
  --bg:#0b1020;
  --card:#0f1426;
  --muted:#97a0af;
  --text:#e7e9ed;
  --accent:#7aa2ff;
  --line:#1b2033;
  --good:#a7f3d0;
}

*{
  box-sizing:border-box;
}

html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font:13px/1.4 ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  min-height:100%;
}

/* Flex wrapper */
body{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  min-height:100vh;
}

/* Desktop vertical centering */
@media (min-width:900px){
  body{
    align-items:center;
  }
}

/* App container */
.app{
  width:100%;
  max-width:720px;
  margin:40px 20px;
}

@media (min-width:900px){
  .app{
    margin:0 auto;
  }
}

/* Spacing helpers */
.pad{padding:10px;}
.stack{display:grid;}
.s6{gap:6px;}
.s8{gap:8px;}
.row{display:flex;justify-content:space-between;align-items:center;}
.small{font-size:12px;}
.tiny{font-size:11px;}
.muted{color:var(--muted);}
.grow{flex:1;}

/* Header / Hero */
.hero{
  display:flex;
  gap:20px;
  align-items:center;
  padding-bottom:12px;
}

.hero-left{flex:0 0 auto;}
.hero-right{flex:1 1 auto;}

.ray-avatar{
  width:64px;
  height:64px;
  border-radius:50%;
  object-fit:cover;
}

@media (max-width:500px){
  .hero{gap:12px;}
}

/* Typography */
h1{
  margin:0;
  font-size:20px;
}
.sub{
  margin:2px 0 0 0;
  font-size:13px;
}
.tagline{
  margin-top:4px;
}

@media (min-width:600px){
  body{font-size:15px;}
  h1{font-size:24px;}
}

/* Cards & inputs */
.card{
  background:var(--card);
  margin:8px 0;
  border:1px solid var(--line);
  border-radius:10px;
}

.lbl{
  display:grid;
  gap:4px;
}

input,
select{
  height:34px;
  border-radius:8px;
  border:1px solid #1e263d;
  background:#0a1022;
  color:var(--text);
  padding:0 10px;
  font-size:13px;
  width:100%;
}

select{
  padding-right:26px;
}

/* Result section */
.result .total{
  font-size:22px;
  font-variant-numeric:tabular-nums;
  color:var(--good);
  margin:4px 0 6px 0;
  line-height:1.2;
}

/* Toggle row styling */
.after-tax-toggle{
  margin-top:6px;
  margin-bottom:4px;
  gap:10px;
}

/* Toggle switch */
.switch{
  position:relative;
  display:inline-block;
  width:40px;
  height:20px;
}
.switch input{
  opacity:0;
  width:0;
  height:0;
}
.slider{
  position:absolute;
  cursor:pointer;
  inset:0;
  background-color:#1e263d;
  border-radius:999px;
  transition:0.2s;
}
.slider:before{
  position:absolute;
  content:"";
  height:16px;
  width:16px;
  left:2px;
  bottom:2px;
  background-color:#e5e7eb;
  border-radius:50%;
  transition:0.2s;
}
.switch input:checked + .slider{
  background-color:#2563eb;
}
.switch input:checked + .slider:before{
  transform:translateX(20px);
}

/* Hidden class */
.hidden{
  display:none;
}

/* Details summary */
details summary{
  cursor:pointer;
  color:var(--accent);
  outline:none;
  list-style:none;
}
details summary::-webkit-details-marker{
  display:none;
}

/* Primary button */
.copy{
  width:100%;
  margin-top:8px;
  height:36px;
  border-radius:8px;
  border:1px solid #2a48ff;
  background:#2237c5;
  color:white;
  cursor:pointer;
  font-size:13px;
}
.copy:hover{
  filter:brightness(1.05);
}

.note{
  margin:6px 0 0 0;
}

.divider{
  border:0;
  border-top:1px solid var(--line);
  margin:6px 0;
}

/* Table */
.table-wrap{
  overflow:auto;
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
thead th{
  text-align:left;
  color:#cbd5e1;
  border-bottom:1px solid var(--line);
  padding:6px 4px;
}
tbody td{
  border-bottom:1px solid var(--line);
  padding:6px 4px;
  color:#d1d5db;
}

/* Footer */
.foot{
  padding-bottom:4px;
}

/* Mortgage button */
#mortgageToggleBtn{
  background:#2237c5 !important;
  border:1px solid #2a48ff !important;
  color:white !important;
  margin-top:8px;
  margin-bottom:4px;
}
#mortgageToggleBtn:hover{
  filter:brightness(1.05);
}

.mortgage{
  margin-top:8px;
}

.mortgage h3{
  margin:0 0 4px 0;
  font-size:14px;
}

.mortgage p{
  margin:0 0 8px 0;
}

/* ====================================================== */
/* ⭐ RAY RECOMMENDS – FADE-IN CARDS                      */
/* ====================================================== */

.ray-recommends {
  margin-top: 18px;
  text-align: left;
  width: 100%;
  opacity: 0;
  display: none;
  transition: opacity 1.8s ease;
}

.ray-recommends.visible {
  opacity: 1;
}

.ray-recommends-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ray-recommends-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1.2s ease 0.3s, transform 1.2s ease 0.3s;
}

.ray-recommends.visible .ray-recommends-avatar {
  opacity: 1;
  transform: scale(1);
}

.ray-recommends-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ray-recommends-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ray-recommends-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 1.0s ease,
    transform 1.0s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.1s ease;
}

.ray-recommends.visible .ray-recommends-card {
  opacity: 1;
  transform: translateY(0);
}

.ray-recommends.visible .ray-recommends-card:nth-child(1) {
  transition-delay: 0.4s;
}

.ray-recommends.visible .ray-recommends-card:nth-child(2) {
  transition-delay: 0.6s;
}

/* ⭐ Text block centering fix */
.ray-recommends-main {
  display: flex;
  flex-direction: column;
  align-items: center; /* horizontally centre title + subtitle */
  text-align: center;  /* centre the text itself */
}

.ray-recommends-name {
  font-size: 13px;
  color: var(--text);
}

.ray-recommends-link {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px; /* visual spacing for centering block */
}

/* Arrow alignment fix */
.ray-recommends-arrow {
  font-size: 16px;
  color: var(--muted);
  align-self: center;
}

/* Hover soft lift */
.ray-recommends-card:hover {
  background-color: rgba(122, 162, 255, 0.18);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ====================================================== */
/* ⭐ ICONS                                               */
/* ====================================================== */

.ray-icon {
  width: 28px;
  height: 28px;
  margin-right: 10px;
  opacity: 0.9;
  flex-shrink: 0;
}
