.tool-dashboard {
    --dash-bg: #f5f7fb;
    --dash-panel: #ffffff;
    --dash-border: #d8dfea;
    --dash-border-strong: #c4cedd;
    --dash-text: #1f2733;
    --dash-muted: #5a6575;
    --dash-head: #0c58b6;
    --dash-head-soft: #eaf3ff;
    --dash-success: #0d8457;
}

.tool-dashboard > p {
    color: var(--dash-muted);
}

.tool-dashboard .calc-mode-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--dash-border-strong);
    border-radius: 12px;
    background: var(--dash-panel);
    overflow: hidden;
    margin: 1rem 0 1.25rem;
}

.tool-dashboard .input-zone {
    margin: 0 0 1rem;
    padding: 0.85rem;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f8fe 100%);
}

.tool-dashboard .dashboard-section-title {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    font-weight: 800;
    color: #234061;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tool-dashboard .dashboard-grid {
    display: grid;
    gap: 0.75rem;
}

.tool-dashboard .dashboard-grid-2 {
    grid-template-columns: 1fr;
}

.tool-dashboard .dashboard-grid-3 {
    grid-template-columns: 1fr;
}

.tool-dashboard .mode-btn {
    border: none;
    background: transparent;
    color: var(--dash-text);
    font-weight: 700;
    padding: 0.82rem 0.9rem;
    cursor: pointer;
    letter-spacing: 0.01em;
}

.tool-dashboard .mode-btn:hover:not(.active) {
    background: #eef2f9;
}

.tool-dashboard .mode-btn.active {
    background: var(--dash-head);
    color: #fff;
}

.tool-dashboard .form-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin: 0 0 0.95rem;
    padding: 0.95rem;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--dash-panel) 0%, var(--dash-bg) 100%);
}

.tool-dashboard .form-group > label {
    display: block;
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dash-text);
    letter-spacing: 0.01em;
}

.tool-dashboard .form-field {
    width: 100%;
    border: 1px solid var(--dash-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--dash-text);
    min-height: 44px;
    padding: 0.65rem 0.8rem;
    font-size: 0.95rem;
}

.tool-dashboard .form-field:focus {
    outline: none;
    border-color: var(--dash-head);
    box-shadow: 0 0 0 3px rgba(12, 88, 182, 0.16);
}

.tool-dashboard .cidr-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.tool-dashboard .btn-group-calc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0 0.8rem;
    padding: 0.75rem;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    background: var(--dash-panel);
}

.tool-dashboard .form-button,
.tool-dashboard .apple-like-btn {
    border: 0;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    background: #0b75ff;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
}

.tool-dashboard .form-button:hover,
.tool-dashboard .apple-like-btn:hover {
    background: #075fca;
}

.tool-dashboard .btn-details,
.tool-dashboard .apple-like-btn.btn-secondary {
    background: #e8edf6;
    color: #1f2733;
}

.tool-dashboard .btn-details:hover,
.tool-dashboard .apple-like-btn.btn-secondary:hover {
    background: #d8e0ee;
}

.tool-dashboard .error {
    display: none;
    margin: 0.6rem 0 0.4rem;
    border: 1px solid #f2c8cc;
    background: #fff1f2;
    color: #8a1f2d;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-weight: 600;
}

.tool-dashboard .error.show {
    display: block;
}

.tool-dashboard .results,
.tool-dashboard .summary-container,
.tool-dashboard .explanation {
    margin-top: 1rem;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    background: var(--dash-panel);
    padding: 1rem;
}

.tool-dashboard .summary-container {
    background: linear-gradient(180deg, #fafdff 0%, #eef5ff 100%);
}

.tool-dashboard .results h3,
.tool-dashboard .summary-container h3,
.tool-dashboard .explanation h3 {
    margin-bottom: 0.65rem;
    font-size: 1.02rem;
    color: var(--dash-head);
}

.tool-dashboard .results + .results {
    margin-top: 1.15rem;
    border-top: 3px solid #ced9ea;
}

.tool-dashboard .results table,
.tool-dashboard .results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--dash-border-strong);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.tool-dashboard .results thead th,
.tool-dashboard .results-table thead th {
    background: #123e79;
    color: #fff;
    border-bottom: 1px solid #0c3264;
    padding: 0.65rem 0.62rem;
    text-align: left;
    font-size: 0.84rem;
    letter-spacing: 0.015em;
}

.tool-dashboard .results th,
.tool-dashboard .results td,
.tool-dashboard .results-table th,
.tool-dashboard .results-table td {
    border-bottom: 1px solid #e8edf5;
    padding: 0.58rem 0.62rem;
    text-align: left;
    vertical-align: top;
    font-size: 0.89rem;
}

.tool-dashboard .results tbody tr:nth-child(odd),
.tool-dashboard .results-table tbody tr:nth-child(odd) {
    background: #f9fbff;
}

.tool-dashboard .results tbody tr:hover,
.tool-dashboard .results-table tbody tr:hover {
    background: #eef5ff;
}

.tool-dashboard .results td,
.tool-dashboard .results-table td {
    font-family: "SF Mono", "Consolas", monospace;
    color: #0d2c59;
    word-break: break-word;
}

.tool-dashboard .results tbody th {
    width: 34%;
    background: #eaf3ff;
    color: #163d73;
    font-weight: 700;
}

.tool-dashboard .results pre {
    margin: 0;
    border: 1px solid var(--dash-border);
    border-radius: 10px;
    background: #f6f9ff;
    padding: 0.82rem;
    color: #0d2c59;
    font-family: "SF Mono", "Consolas", monospace;
}

.tool-dashboard .results-table-container {
    overflow-x: auto;
}

.tool-dashboard #cidr-bit-usage {
    margin: 0.4rem 0 0;
    padding: 0.72rem;
    border-radius: 10px;
    border: 1px solid var(--dash-border);
    background: #f8fbff;
    font-family: "SF Mono", "Consolas", monospace;
    color: #234d86;
    font-size: 0.9rem;
}

.tool-dashboard .preset-btn.form-button {
    font-size: 0.82rem;
    padding: 0.55rem 0.8rem;
}

.tool-dashboard .preset-group {
    margin: 0.9rem 0 0;
}

.tool-dashboard .preset-group .btn-group-calc {
    border: 0;
    padding: 0;
    margin: 0.4rem 0 0;
    background: transparent;
}

.seo-article-content .callout-box {
    margin-top: 1rem;
}

.seo-article-content .callout-box .callout-icon {
    min-width: 56px;
    height: 24px;
    margin-right: 0.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.seo-article-content .callout-box.info .callout-icon {
    background: #d8ecff;
    color: #0d4f93;
}

.seo-article-content .callout-box.tip .callout-icon {
    background: #dff3e4;
    color: #1b6a35;
}

.seo-article-content .callout-box.warning .callout-icon {
    background: #ffe8cc;
    color: #8a4a00;
}

body.dark-mode .tool-dashboard {
    --dash-bg: #20242e;
    --dash-panel: #1a1f29;
    --dash-border: #323a48;
    --dash-border-strong: #3d4658;
    --dash-text: #e2e8f2;
    --dash-muted: #b0bac8;
    --dash-head: #5fa9ff;
    --dash-head-soft: #1c2a3d;
}

body.dark-mode .tool-dashboard .mode-btn:hover:not(.active) {
    background: #252c39;
}

body.dark-mode .tool-dashboard .input-zone {
    background: linear-gradient(180deg, #1b202b 0%, #1f2735 100%);
}

body.dark-mode .tool-dashboard .dashboard-section-title {
    color: #cde2ff;
}

body.dark-mode .tool-dashboard .form-group {
    background: linear-gradient(180deg, #1b202b 0%, #1f2430 100%);
}

body.dark-mode .tool-dashboard .form-field {
    background: #11151d;
    border-color: #394257;
    color: #e2e8f2;
}

body.dark-mode .tool-dashboard .form-field:focus {
    border-color: #5fa9ff;
    box-shadow: 0 0 0 3px rgba(95, 169, 255, 0.2);
}

body.dark-mode .tool-dashboard .btn-details,
body.dark-mode .tool-dashboard .apple-like-btn.btn-secondary {
    background: #2a3242;
    color: #e2e8f2;
}

body.dark-mode .tool-dashboard .btn-details:hover,
body.dark-mode .tool-dashboard .apple-like-btn.btn-secondary:hover {
    background: #36405a;
}

body.dark-mode .tool-dashboard .results thead th,
body.dark-mode .tool-dashboard .results-table thead th {
    background: #1b4f94;
    border-bottom-color: #133b6f;
}

body.dark-mode .tool-dashboard .results table,
body.dark-mode .tool-dashboard .results-table {
    background: #171c26;
    border-color: #394257;
}

body.dark-mode .tool-dashboard .results th,
body.dark-mode .tool-dashboard .results td,
body.dark-mode .tool-dashboard .results-table th,
body.dark-mode .tool-dashboard .results-table td {
    border-bottom-color: #2d3545;
}

body.dark-mode .tool-dashboard .results tbody tr:nth-child(odd),
body.dark-mode .tool-dashboard .results-table tbody tr:nth-child(odd) {
    background: #1d2330;
}

body.dark-mode .tool-dashboard .results tbody tr:hover,
body.dark-mode .tool-dashboard .results-table tbody tr:hover {
    background: #263145;
}

body.dark-mode .tool-dashboard .results td,
body.dark-mode .tool-dashboard .results-table td {
    color: #8ec3ff;
}

body.dark-mode .tool-dashboard .results tbody th {
    background: #24324a;
    color: #cde3ff;
}

body.dark-mode .tool-dashboard .summary-container {
    background: linear-gradient(180deg, #1d2430 0%, #222b3a 100%);
}

body.dark-mode .seo-article-content .callout-box.info .callout-icon {
    background: #26466a;
    color: #cfe7ff;
}

body.dark-mode .seo-article-content .callout-box.tip .callout-icon {
    background: #234c34;
    color: #d4f7df;
}

body.dark-mode .seo-article-content .callout-box.warning .callout-icon {
    background: #5a4122;
    color: #ffe8c7;
}

body.dark-mode .tool-dashboard .results pre,
body.dark-mode .tool-dashboard #cidr-bit-usage {
    background: #11161f;
    border-color: #394257;
    color: #a3cbff;
}

@media (max-width: 980px) {
    .tool-dashboard .cidr-grid {
        grid-template-columns: 1fr;
    }

    .tool-dashboard .dashboard-grid-3,
    .tool-dashboard .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .tool-dashboard .calc-mode-selector {
        grid-template-columns: 1fr;
    }

    .tool-dashboard .results tbody th {
        width: 46%;
    }
}
