.tdcmw-widget,
.tdcmw-widget * {
    box-sizing: border-box;
}

.tdcmw-widget {
    --tdcmw-blue: #155b91;
    --tdcmw-blue-dark: #0d3f68;
    --tdcmw-blue-soft: #eaf3fa;
    --tdcmw-text: #182433;
    --tdcmw-muted: #687789;
    --tdcmw-border: #e3e9ef;
    --tdcmw-green: #168451;
    --tdcmw-red: #cf3f4b;
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    padding: clamp(18px, 3vw, 30px);
    color: var(--tdcmw-text);
    background: #fff;
    border: 1px solid var(--tdcmw-border);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(19, 47, 74, .07);
    font-family: inherit;
    line-height: 1.5;
    overflow: hidden;
}

.tdcmw-widget button {
    font: inherit;
    cursor: pointer;
}

.tdcmw-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.tdcmw-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--tdcmw-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
}

.tdcmw-heading-copy h2 {
    margin: 0 0 3px;
    color: var(--tdcmw-text);
    font-size: clamp(22px, 3vw, 29px);
    font-weight: 750;
    line-height: 1.2;
}

.tdcmw-heading-copy p {
    margin: 0;
    color: var(--tdcmw-muted);
    font-size: 14px;
}

.tdcmw-refresh {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 14px;
    color: var(--tdcmw-blue-dark);
    background: #fff;
    border: 1px solid #cbd9e5;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: background .18s ease, border-color .18s ease;
}

.tdcmw-refresh:hover,
.tdcmw-refresh:focus-visible {
    background: var(--tdcmw-blue-soft);
    border-color: #9ebbd2;
}

.tdcmw-refresh:disabled {
    cursor: wait;
    opacity: .65;
}

.tdcmw-refresh-icon {
    display: inline-block;
    font-size: 19px;
    line-height: 1;
}

.tdcmw-refresh.is-loading .tdcmw-refresh-icon {
    animation: tdcmw-spin .8s linear infinite;
}

@keyframes tdcmw-spin {
    to { transform: rotate(360deg); }
}

.tdcmw-tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    background: #f3f6f9;
    border: 1px solid #edf1f5;
    border-radius: 11px;
}

.tdcmw-tab {
    display: flex;
    flex: 1 1 50%;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 11px 13px;
    color: #536273;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
}

.tdcmw-tab.is-active {
    color: var(--tdcmw-text);
    background: #fff;
    border-color: #e4eaf0;
    box-shadow: 0 2px 7px rgba(20, 43, 65, .06);
}

.tdcmw-coin-icon {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 19px;
    font-weight: 800;
}

.tdcmw-bitcoin { color: #fff; background: #ed9b24; }
.tdcmw-ethereum { color: #fff; background: #6677a8; font-size: 16px; }

.tdcmw-tab strong,
.tdcmw-tab small {
    display: block;
}

.tdcmw-tab strong {
    font-size: 14px;
    line-height: 1.3;
}

.tdcmw-tab small {
    margin-top: 2px;
    color: var(--tdcmw-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.tdcmw-market-panel {
    display: grid;
    grid-template-columns: minmax(220px, .85fr) minmax(0, 1.5fr);
    gap: 28px;
    align-items: center;
    padding: 27px 2px 22px;
}

.tdcmw-current-label {
    color: var(--tdcmw-muted);
    font-size: 14px;
    font-weight: 650;
}

.tdcmw-pair { color: #8b98a6; font-weight: 500; }

.tdcmw-price {
    margin: 7px 0 2px;
    color: var(--tdcmw-text);
    font-size: clamp(29px, 4vw, 41px);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.tdcmw-price-foot {
    display: flex;
    gap: 7px;
    align-items: center;
    color: var(--tdcmw-muted);
    font-size: 12px;
}

.tdcmw-ticker { color: var(--tdcmw-blue); font-weight: 800; }

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

.tdcmw-stat {
    min-width: 0;
    padding: 13px 15px;
    background: #f8fafc;
    border: 1px solid #edf1f5;
    border-radius: 9px;
}

.tdcmw-stat-label {
    display: block;
    margin-bottom: 5px;
    color: var(--tdcmw-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .075em;
}

.tdcmw-stat strong {
    display: block;
    color: var(--tdcmw-text);
    font-size: clamp(14px, 2vw, 17px);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.tdcmw-stat strong.is-positive { color: var(--tdcmw-green); }
.tdcmw-stat strong.is-negative { color: var(--tdcmw-red); }

.tdcmw-updated-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 11px 0 14px;
    color: var(--tdcmw-muted);
    border-top: 1px solid var(--tdcmw-border);
    font-size: 11px;
}

.tdcmw-live-dot {
    width: 7px;
    height: 7px;
    background: #21a56c;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(33, 165, 108, .12);
}

.tdcmw-data-basis { margin-left: auto; }

.tdcmw-history-actions {
    display: flex;
    justify-content: flex-start;
    padding: 13px 0 2px;
    border-top: 1px solid var(--tdcmw-border);
}

.tdcmw-history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    color: var(--tdcmw-blue);
    background: var(--tdcmw-blue-soft);
    border: 1px solid #d6e6f2;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 750;
}

.tdcmw-history-toggle:hover,
.tdcmw-history-toggle:focus-visible {
    background: #dcebf6;
}

.tdcmw-chart-icon { font-size: 20px; line-height: 1; }
.tdcmw-chevron { margin-left: 3px; font-size: 16px; transition: transform .18s ease; }
.tdcmw-history-toggle[aria-expanded="true"] .tdcmw-chevron { transform: rotate(180deg); }

.tdcmw-chart-panel {
    margin-top: 15px;
    padding: 20px 18px 14px;
    background: #fff;
    border: 1px solid var(--tdcmw-border);
    border-radius: 11px;
}

.tdcmw-chart-panel[hidden] { display: none !important; }

.tdcmw-chart-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}

.tdcmw-chart-topline h3 {
    margin: 0 0 3px;
    color: var(--tdcmw-text);
    font-size: 17px;
    font-weight: 750;
}

.tdcmw-chart-topline p {
    margin: 0;
    color: var(--tdcmw-muted);
    font-size: 12px;
}

.tdcmw-range-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px;
    background: #f2f5f8;
    border-radius: 8px;
}

.tdcmw-range-buttons button {
    min-width: 39px;
    padding: 6px 9px;
    color: #607184;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.tdcmw-range-buttons button.is-active {
    color: #fff;
    background: var(--tdcmw-blue);
    box-shadow: 0 1px 4px rgba(14, 67, 107, .2);
}

.tdcmw-chart-wrap {
    position: relative;
    width: 100%;
    min-height: 190px;
}

.tdcmw-chart {
    display: block;
    width: 100%;
    height: 260px;
    overflow: visible;
}

.tdcmw-chart-gridline { stroke: #e9eef3; stroke-width: 1; }
.tdcmw-chart-line { fill: none; stroke: #17669f; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.tdcmw-chart-area { fill: var(--tdcmw-chart-fill, url(#tdcmw-chart-gradient)); }
.tdcmw-chart-label { fill: #788798; font-family: inherit; font-size: 15px; }
.tdcmw-chart-point { fill: #fff; stroke: #17669f; stroke-width: 3; }

.tdcmw-chart-message {
    padding: 23px 12px;
    color: var(--tdcmw-muted);
    text-align: center;
    font-size: 13px;
}

.tdcmw-chart-message[hidden] { display: none !important; }
.tdcmw-chart-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    color: #536273;
    font-size: 11px;
    font-weight: 700;
}

.tdcmw-legend-line { display: inline-block; width: 19px; height: 3px; background: #17669f; border-radius: 4px; }
.tdcmw-chart-note { margin-left: auto; color: #8793a0; font-weight: 500; }

.tdcmw-disclaimer {
    margin-top: 18px;
    padding: 14px 16px;
    background: #f7f9fb;
    border: 1px solid #e8edf2;
    border-left: 3px solid #98adbf;
    border-radius: 7px;
}

.tdcmw-disclaimer strong {
    display: block;
    margin-bottom: 4px;
    color: #526273;
    font-size: 12px;
    font-weight: 800;
}

.tdcmw-disclaimer p {
    margin: 0;
    color: #6b7886;
    font-size: 11px;
    line-height: 1.65;
}

.tdcmw-widget button:focus-visible {
    outline: 3px solid rgba(21, 91, 145, .25);
    outline-offset: 2px;
}

@media (max-width: 680px) {
    .tdcmw-widget { padding: 17px; border-radius: 12px; }
    .tdcmw-heading-row { align-items: flex-start; }
    .tdcmw-refresh { min-height: 37px; padding: 7px 10px; }
    .tdcmw-market-panel { grid-template-columns: 1fr; gap: 18px; padding-top: 22px; }
    .tdcmw-stats-grid { gap: 8px; }
    .tdcmw-stat { padding: 11px; }
    .tdcmw-chart-panel { padding: 15px 11px 12px; }
    .tdcmw-chart-topline { align-items: flex-start; }
    .tdcmw-chart { height: 220px; }
    .tdcmw-data-basis { margin-left: 15px; }
}

@media (max-width: 390px) {
    .tdcmw-heading-copy h2 { font-size: 21px; }
    .tdcmw-refresh { gap: 4px; font-size: 12px; }
    .tdcmw-tab { padding: 9px 7px; gap: 7px; }
    .tdcmw-range-buttons { width: 100%; justify-content: space-between; }
    .tdcmw-range-buttons button { flex: 1; min-width: 0; padding-inline: 5px; }
}
