/* ============================================================
   Decimal ⇄ Fraction Conversion Calculator
   F.Robin Technologies · scoped to .dfc-wrap
   ============================================================ */
.dfc-wrap {
  --cyan:#00BFFF; --cyan-d:#0099CC; --dark:#0d0d0d; --dark2:#0a1628;
  --white:#fff; --off:#f5f7fa; --border:#e5e7eb; --grey:#6b7280;
  --text:#1a1a1a; --green:#10b981; --red:#e05a4d; --radius:10px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:"Courier New",monospace;
  font-family:var(--font); color:var(--text); background:var(--white);
  border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:0 4px 24px rgba(0,0,0,.09); max-width:640px; margin:2em auto; overflow:hidden;
}

.dfc-header { background:linear-gradient(135deg,#0d0d0d 0%,#0a1628 100%); color:#fff; padding:24px 28px 20px; text-align:center; }
.dfc-icon { margin-bottom:6px; }
.dfc-title { margin:0 0 5px; font-size:1.3rem; font-weight:800; color:#fff; border:none; padding:0; line-height:1.2; }
.dfc-subtitle { margin:0; font-size:.82rem; color:rgba(255,255,255,.6); line-height:1.5; }

.dfc-body { padding:20px 20px 22px; }

/* Mode tabs */
.dfc-modes { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:18px; }
.dfc-mode { flex:1 1 auto; padding:8px 10px; border:1.5px solid var(--border); border-radius:8px; background:var(--off); color:var(--grey); font-size:.78rem; font-weight:700; cursor:pointer; font-family:var(--font); transition:all .15s; white-space:nowrap; }
.dfc-mode:hover { border-color:var(--cyan); color:var(--cyan); }
.dfc-mode-active { background:var(--cyan); color:#000; border-color:var(--cyan); box-shadow:0 2px 8px rgba(0,191,255,.25); }

/* Panes */
.dfc-label { display:block; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--grey); margin:0 0 6px; }
.dfc-input { width:100%; border:1.5px solid var(--border); border-radius:8px; background:var(--white); font-size:1.05rem; font-weight:700; font-family:var(--font); color:var(--text); padding:11px 13px; box-sizing:border-box; outline:none; transition:border-color .15s, box-shadow .15s; margin-bottom:12px; }
.dfc-input:focus { border-color:var(--cyan); box-shadow:0 0 0 3px rgba(0,191,255,.13); }
.dfc-input::placeholder { color:#b8bfc9; font-weight:400; }
.dfc-mono { font-family:var(--mono); letter-spacing:.05em; }
.dfc-select { cursor:pointer; }

.dfc-input-row { display:flex; align-items:center; gap:0; border:1.5px solid var(--border); border-radius:8px; overflow:hidden; margin-bottom:12px; }
.dfc-input-row:focus-within { border-color:var(--cyan); box-shadow:0 0 0 3px rgba(0,191,255,.13); }
.dfc-input-row .dfc-input { border:none; box-shadow:none; margin:0; border-radius:0; }
.dfc-unit { padding:0 14px; font-size:1rem; font-weight:700; color:var(--grey); background:var(--off); align-self:stretch; display:flex; align-items:center; border-left:1px solid var(--border); }

.dfc-check { display:flex; align-items:flex-start; gap:8px; font-size:.78rem; color:var(--grey); line-height:1.5; margin-bottom:12px; cursor:pointer; }
.dfc-check input { margin-top:2px; flex-shrink:0; width:15px; height:15px; accent-color:var(--cyan); }
.dfc-check code, .dfc-hint code { background:var(--off); border:1px solid var(--border); border-radius:4px; padding:1px 5px; font-family:var(--mono); font-size:.9em; color:var(--cyan-d); }
.dfc-hint { font-size:.76rem; color:var(--grey); margin:0 0 12px; line-height:1.5; }

/* Fraction input */
.dfc-frac-row { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.dfc-whole { width:70px; flex:0 0 70px; margin:0; text-align:center; }
.dfc-frac-stack { display:flex; flex-direction:column; gap:4px; width:110px; }
.dfc-frac-stack .dfc-input { margin:0; text-align:center; padding:8px; }
.dfc-frac-bar { height:2px; background:var(--text); border-radius:2px; }

/* Button */
.dfc-btn { width:100%; padding:12px; border:none; border-radius:8px; background:var(--cyan); color:#000; font-size:.95rem; font-weight:800; cursor:pointer; font-family:var(--font); transition:background .15s; box-shadow:0 2px 8px rgba(0,191,255,.28); }
.dfc-btn:hover { background:var(--cyan-d); }
.dfc-btn:active { transform:scale(.99); }

/* Message */
.dfc-msg { border-radius:8px; font-size:.85rem; font-weight:600; }
.dfc-msg:not(:empty){ padding:.7em 1em; margin-top:14px; }
.dfc-msg.dfc-error { background:#fce8e6; color:#c0392b; border:1px solid #f5c6c2; }

/* Result */
.dfc-result { display:none; margin-top:16px; background:linear-gradient(135deg,#0d0d0d,#0a1628); border-radius:var(--radius); padding:20px 22px; text-align:center; animation:dfcFade .25s ease; }
@keyframes dfcFade { from{opacity:0;transform:translateY(6px);} to{opacity:1;transform:translateY(0);} }
.dfc-big { font-size:2.2rem; font-weight:900; color:var(--cyan); font-family:var(--mono); line-height:1.1; word-break:break-all; }
.dfc-sub { font-size:.82rem; color:rgba(255,255,255,.55); margin-top:6px; margin-bottom:14px; }
.dfc-rows { display:flex; flex-direction:column; gap:1px; background:rgba(255,255,255,.08); border-radius:8px; overflow:hidden; text-align:left; }
.dfc-row { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 14px; background:rgba(255,255,255,.03); }
.dfc-row-l { font-size:.78rem; color:rgba(255,255,255,.6); font-weight:600; }
.dfc-row-v { font-size:.92rem; color:#fff; font-weight:800; font-family:var(--mono); text-align:right; word-break:break-all; }

/* Chart */
.dfc-chart { margin-top:18px; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.dfc-chart summary { padding:12px 16px; font-size:.85rem; font-weight:700; color:var(--text); cursor:pointer; background:var(--off); list-style:none; user-select:none; }
.dfc-chart summary::-webkit-details-marker { display:none; }
.dfc-chart summary::before { content:'▸ '; color:var(--cyan); font-weight:900; }
.dfc-chart[open] summary::before { content:'▾ '; }
.dfc-chart-body { max-height:320px; overflow-y:auto; }
.dfc-table { width:100%; border-collapse:collapse; font-size:.86rem; }
.dfc-table th { background:var(--dark); color:var(--cyan); font-weight:700; padding:9px 14px; text-align:left; position:sticky; top:0; font-size:.76rem; text-transform:uppercase; letter-spacing:.04em; }
.dfc-table td { padding:8px 14px; border-bottom:1px solid var(--border); font-family:var(--mono); font-weight:700; color:var(--text); }
.dfc-table tr:nth-child(even) td { background:var(--off); }

/* Responsive */
@media (max-width:560px){
  .dfc-modes .dfc-mode { flex:1 1 45%; font-size:.72rem; }
  .dfc-big { font-size:1.7rem; }
  .dfc-body { padding:14px 12px 16px; }
}
