/* Scope trong .ircalc-root để không xung đột theme */
.ircalc-root, .ircalc-root *{ box-sizing:border-box }
.ircalc-root h1,.ircalc-root h2,.ircalc-root h3,.ircalc-root p,.ircalc-root ol,.ircalc-root ul{ margin:0 }
.ircalc-root ol,.ircalc-root ul{ padding-left:1.2rem }
.ircalc-root h2 {
    font-size: 24px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.ircalc-root h3 {
    font-size: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
}
.ircalc-root{
  --bg:#fff; --panel:#0f172a; --panel-2:#0b1324; --text:#e8edf7; --muted:#a8b3cf; --line:#1f2c4a;
  --accent:#6ea8fe; --accent-2:#22d3ee; --radius:18px; --shadow:0 10px 30px rgba(0,0,0,.25);
  font:16px/1.6 Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif; color:var(--text); background:var(--bg)
}
.ircalc-root[data-theme="light"]{
  --bg:#fff; --panel:#fff; --panel-2:#f4f7ff; --text:#0f172a; --muted:#51607a; --line:#e6ecf7; --shadow:0 10px 24px rgba(2,6,23,.08)
}

/* Layout */
.ircalc-wrap{ margin:auto; }
.ircalc-header{ background:linear-gradient(90deg,#5b8cff,#8a68ff); color:#fff; border-radius:0 0 var(--radius) var(--radius); box-shadow:var(--shadow) }
.ircalc-hero{ display:grid; grid-template-columns:1fr auto; gap:16px; align-items:center }
.ircalc-title{ font-size:clamp(20px,4vw,28px); font-weight:800; margin:0 0 6px }
.ircalc-subtitle{ opacity:.92 }


.ircalc-card{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:15px; margin-bottom: 20px;}

/* Form */
.ircalc-section-title{ margin-bottom:12px }
.ircalc-row{ display:grid; gap:12px }
@media(min-width:720px){ .ircalc-row{ grid-template-columns:1fr 1fr } }
.ircalc-field label{ display:block; font-weight:700; margin-bottom:6px }
.ircalc-hint{ color:var(--muted); font-size:13px; margin-top:4px }

.ircalc-field input[type="text"],
.ircalc-field input[type="number"],
.ircalc-field select{
  appearance:none; -webkit-appearance:none;
  width:100%; height:48px; padding:10px 14px;
  border:1px solid var(--line); border-radius:12px;
  background:var(--panel-2); color:var(--text); font:inherit; line-height:1.2
}
.ircalc-field select{
  padding-right:42px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2351607a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat; background-position:right 14px center; background-size:14px
}
.ircalc-field input:focus, .ircalc-field select:focus{
  border-color:#7aa9ff; box-shadow:0 0 0 3px rgba(106,152,255,.25); outline:0
}

/* Group nhỏ 2 ô năm/tháng */
.ircalc-duo{ display:grid; grid-template-columns:1fr 1fr; gap:10px }

/* Radio (mỗi tùy chọn 1 hàng, mobile-friendly) */
.ircalc-mode{ display:grid; grid-template-columns:1fr; gap:12px; margin:0 0 8px; border:0; padding:0 }
.ircalc-legend{ font-weight:800; margin-bottom:6px }
.ircalc-radio{
  display:flex; align-items:center; gap:12px; padding:12px 14px; width:100%; min-height:52px;
  border:1px solid var(--line); border-radius:12px; background:var(--panel); cursor:pointer; user-select:none
}
.ircalc-radio input{
  appearance:none; -webkit-appearance:none; width:20px; height:20px; margin:0;
  border:2px solid var(--muted); border-radius:50%; background:transparent; display:inline-grid; place-items:center; flex:0 0 20px
}
.ircalc-radio input::before{ content:""; width:10px; height:10px; border-radius:50%; transform:scale(0); background:linear-gradient(90deg,var(--accent-2),var(--accent)); transition:transform .18s }
.ircalc-radio input:checked{ border-color:var(--accent) }
.ircalc-radio input:checked::before{ transform:scale(1) }
.ircalc-radio span{ display:block; line-height:1.35; font-weight:600 }

/* Buttons */
.ircalc-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px }
.ircalc-btn{ appearance:none; border:0; border-radius:999px; background:rgba(255,255,255,.16); color:#fff; padding:10px 14px; font-weight:700; cursor:pointer }
.ircalc-btn:hover{ filter:brightness(1.08) }
.ircalc-btn-solid{ background:linear-gradient(90deg,#5b8cff,#8a68ff) }
.ircalc-btn-ghost{ background:transparent; border:1px solid var(--line); color:inherit }

/* Result */
.ircalc-pill{ display:inline-flex; align-items:center; gap:8px; background:var(--panel-2); border:1px solid var(--line); padding:8px 12px; border-radius:999px; font-weight:800 }
.ircalc-table-wrap{ margin-top:14px; overflow:auto }
.ircalc-table{ width:100%; border-collapse:separate; border-spacing:0 }
.ircalc-table thead th{ background:var(--panel-2); border:1px solid var(--line); border-bottom:0; padding:10px 12px; text-align:left }
.ircalc-table tbody td{ border:1px solid var(--line); padding:10px 12px }

/* SEO/FAQ */
.ircalc-seo details{ background:var(--panel); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); margin:12px 0; overflow:hidden }
.ircalc-seo summary{ list-style:none; cursor:pointer; padding:10px 10px; font-weight:700; display:flex; align-items:center; gap:10px; background:var(--panel-2); border-bottom:1px solid var(--line) }
.ircalc-seo summary::-webkit-details-marker{ display:none }
.ircalc-seo summary::after{ content:"▾"; margin-left:auto; font-weight:800; opacity:.9; transition:transform .25s }
.ircalc-seo details[open] summary::after{ transform:rotate(-180deg) }
.ircalc-seo details>*:not(summary){ padding:14px 16px; color:var(--text) }

/* Misc */
.ircalc-err{ color:#ef4444; font-size:14px; margin-top:10px }
.ircalc-footer{ text-align:center; color:var(--muted); opacity:.8; margin:20px auto }
