/* ============================================================
   Data Storage Converter — tool-specific styles on base.css.
   No :root / theme; consumes base tokens only.
   ============================================================ */

.ds-tool { background: var(--bg); transition: background 0.5s; }
.ds-tool .tool-instructions-wrapper { text-align: center; margin-bottom: 24px; }
.ds-tool .tool-section-title {
    font-family: var(--font-head); font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--text);
    margin: 0 0 12px; letter-spacing: -0.3px;
}
.ds-tool .text-primary-red { color: var(--accent-2); }
.ds-tool .tool-section-texte {
    color: var(--text-muted); font-size: 0.95rem; line-height: 1.7;
    max-width: 720px; margin: 0 auto;
}

.ds-panel {
    background: var(--panel-bg); border: 1px solid var(--panel-border);
    border-radius: var(--radius); box-shadow: var(--shadow-soft);
    padding: 24px; max-width: 720px; margin: 0 auto;
}

/* Base toggle */
.ds-base {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    justify-content: center; margin-bottom: 22px; padding-bottom: 18px;
    border-bottom: 1px solid var(--panel-border);
}
.ds-base-label { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.ds-base-opt {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--text); font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.ds-base-opt input { accent-color: var(--purple); cursor: pointer; }

/* Convert row */
.ds-convert { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; }
@media (max-width: 620px) {
    .ds-convert { grid-template-columns: 1fr; }
    .ds-swap { justify-self: center; transform: rotate(90deg); }
}
.ds-side { display: flex; flex-direction: column; gap: 8px; }

.ds-input, .ds-select {
    width: 100%; box-sizing: border-box; 
    background: var(--card-bg); color: var(--text);
    border: 1.5px solid var(--border-color); border-radius: var(--radius-sm);
    font-family: var(--font-head); font-size: 1.05rem; font-weight: 600;
}
.ds-input:focus, .ds-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(231,76,60,0.15); }
.ds-input--out { background: var(--panel-bg); color: var(--accent-2); font-weight: 800; font-family: var(--font-mono); }
.ds-select {
    cursor: pointer; appearance: none; -webkit-appearance: none; -moz-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='%23a855f7' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

.ds-swap {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: var(--transition); margin-bottom: 2px;
}
.ds-swap:hover { background: var(--purple); border-color: var(--purple); color: #fff; transform: rotate(180deg); }

.ds-formula {
    text-align: center; margin: 18px 0; padding-top: 16px;
    border-top: 1px solid var(--panel-border);
    color: var(--text); font-size: 0.98rem; font-weight: 700; min-height: 1.2em;
}

/* Breakdown table */
.ds-breakdown { margin-top: 6px; }
.ds-breakdown-title { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.ds-table { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ds-row {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); padding: 10px 14px;
}
.ds-row-unit { color: var(--text-muted); font-size: 0.88rem; font-weight: 600; }
.ds-row-val { color: var(--text); font-family: var(--font-mono); font-size: 0.92rem; font-weight: 700; word-break: break-all; text-align: right; }

/* Dark-mode: keep custom select arrow */
body.dark-mode .ds-tool .ds-select,
body.dark-mode-spinumbers .ds-tool .ds-select {
    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='%23a855f7' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
}