.dfc-tool {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --surface: #eef3f8;
    --editor-bg: #ffffff;
    --editor-text: #152238;
    --text: #1f2937;
    --muted: #62738a;
    --line: rgba(92, 112, 138, .18);
    --accent: #0ea5e9;
    --accent-2: #2563eb;
    --accent-text: #ffffff;
    --button-bg: #ffffff;
    --button-text: #1f2937;
    --danger: #b91c1c;
    --shadow: 0 18px 40px rgba(50, 79, 123, .08);
    color: var(--text);
    background-color: var(--bg);
    background-image: none;
    border-radius: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    overflow: visible;
    padding: 0;
}

.dfc-tool[data-theme="dark"] {
    --bg: #0d1424;
    --panel: #121a2d;
    --panel-strong: #0f1728;
    --surface: #162238;
    --editor-bg: #0b1221;
    --editor-text: #e9f1ff;
    --text: #edf4ff;
    --muted: #a9b7cc;
    --line: rgba(154, 173, 204, .24);
    --accent: #22c7d8;
    --accent-2: #4f7cff;
    --accent-text: #07121f;
    --button-bg: #1a263d;
    --button-text: #edf4ff;
    --danger: #ff8a98;
    --shadow: 0 30px 80px rgba(0, 0, 0, .30);
    background: linear-gradient(135deg, #0d1424 0%, #111827 56%, #0a1020 100%);
}

.dfc-tool *, .dfc-tool *::before, .dfc-tool *::after { box-sizing: border-box; }
.dfc-tool button, .dfc-tool input, .dfc-tool textarea { font: inherit; }
.dfc-tool a { color: inherit; text-decoration: none; }

.dfc-hero, .dfc-workspace, .dfc-content, .dfc-howto, .dfc-faq, .dfc-related {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.dfc-hero {
    min-height: 340px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    padding: 56px 0 30px;
}

.dfc-kicker {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.dfc-hero h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(2.15rem, 5vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.dfc-hero p:not(.dfc-kicker) {
    max-width: 760px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.04rem;
}

.dfc-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.dfc-stats span, .dfc-theme, .dfc-tabs, .dfc-toolbar, .dfc-panel, .dfc-content article, .dfc-howto article, .dfc-faq details, .dfc-related a {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.dfc-stats span {
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--muted);
}

.dfc-stats strong { color: var(--text); }

.dfc-theme {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 132px;
    border-radius: 6px;
    color: var(--text);
    padding: 12px 16px;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease;
}

.dfc-theme:hover { transform: translateY(-1px); }

.dfc-theme span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 26px rgba(53, 208, 186, .18);
}

.dfc-workspace {
    padding: 0 0 34px;
}

.dfc-tabs {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    background: var(--surface);
}

.dfc-tabs button, .dfc-btn, .dfc-icon-btn {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--button-text);
    font: inherit;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dfc-tabs button {
    flex: 1;
    padding: 14px 18px;
    font-weight: 800;
    letter-spacing: .01em;
    opacity: .86;
}

.dfc-tabs button span::before { content: "<-> "; color: var(--accent); }
.dfc-tabs button.is-active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-text);
    box-shadow: 0 14px 30px rgba(53, 208, 186, .16);
    opacity: 1;
}

.dfc-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 20px;
    padding: 16px;
    border-radius: 8px;
    background: var(--surface);
}

.dfc-btn, .dfc-icon-btn {
    padding: 12px 16px;
    background: var(--button-bg);
    border-color: var(--line);
}

.dfc-btn:hover, .dfc-icon-btn:hover, .dfc-tabs button:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.dfc-btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-text);
    border-color: transparent;
}

.dfc-btn.is-active, .dfc-btn-primary.is-active {
    box-shadow: 0 18px 44px rgba(53, 208, 186, .20);
}

.dfc-check { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.dfc-status { margin-left: auto; color: var(--muted); font-size: .92rem; min-width: 180px; text-align: right; }

.dfc-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 18px;
}

.dfc-panel {
    min-height: 560px;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, .18);
    background: var(--panel);
}

.dfc-panel header, .dfc-panel footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.dfc-panel footer {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    color: var(--muted);
    font-size: .88rem;
    background: rgba(0, 0, 0, .04);
}

.dfc-panel h2, .dfc-content h2, .dfc-howto h2, .dfc-faq h2, .dfc-related h2 { margin: 0; letter-spacing: 0; }
.dfc-panel header p { margin: 0; color: var(--accent); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.dfc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.dfc-actions input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.dfc-drop {
    position: relative;
    flex: 1;
    min-height: 430px;
    background: var(--editor-bg);
}

.dfc-drop.is-dragging {
    outline: 2px dashed var(--accent);
    outline-offset: 0;
}

.dfc-drop::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.dfc-drop textarea, .dfc-output {
    width: 100%;
    height: 100%;
    min-height: 430px;
    margin: 0;
    padding: 20px 20px 20px 34px;
    border: 0;
    outline: 0;
    resize: none;
    color: var(--editor-text);
    background: transparent;
    font: 500 14px/1.75 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    tab-size: 2;
    white-space: pre-wrap;
    overflow: auto;
}

.dfc-output {
    flex: 1;
    padding-left: 20px;
}

.dfc-output::before {
    content: "";
}

.dfc-drop textarea:focus, .dfc-output:focus { outline: 2px solid rgba(53, 208, 186, .35); outline-offset: -2px; }
.dfc-drop textarea::placeholder { color: color-mix(in srgb, var(--editor-text) 42%, transparent); }

.dfc-error {
    margin-top: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(185, 49, 60, .45);
    border-radius: 6px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, var(--panel));
}

.dfc-ad-banner, .dfc-ad-panel {
    width: min(100%, 1100px);
    margin: 0 auto 26px;
    padding: 18px 20px;
    border-radius: 0;
    border: 1px solid rgba(148, 163, 184, .18);
    background: var(--surface);
    color: var(--text);
    box-shadow: none;
}

.dfc-ad-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dfc-ad-slot strong {
    display: block;
    font-size: .98rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
}

.dfc-ad-slot p {
    flex: 1;
    margin: 0;
    color: var(--muted);
    max-width: 860px;
}

.dfc-content, .dfc-howto, .dfc-faq, .dfc-related {
    padding: 38px 0;
}

.dfc-content-copy {
    margin-top: 20px;
    padding: 24px;
    border-radius: 0;
    border: 1px solid rgba(148, 163, 184, .18);
    background: var(--panel);
}

.dfc-content-copy p {
    margin: 0 0 14px;
    color: var(--muted);
    max-width: 900px;
}

.dfc-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.dfc-benefits li {
    position: relative;
    padding-left: 24px;
    color: var(--text);
}

.dfc-benefits li::before {
    content: "*";
    position: absolute;
    left: 0;
    color: var(--accent);
}

@media (max-width: 860px) {
    .dfc-benefits { gap: 10px; }
}

.dfc-content > div:first-child { max-width: 820px; }
.dfc-content p, .dfc-faq p { color: var(--muted); }
.dfc-card-grid, .dfc-howto-grid, .dfc-related nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.dfc-content article, .dfc-howto article, .dfc-faq details, .dfc-related a {
    border-radius: 0;
    padding: 22px;
}

.dfc-content h3, .dfc-howto h3 { margin: 0 0 8px; }
.dfc-howto > p, .dfc-howto > h2 { max-width: 860px; }
.dfc-howto article strong {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    border-radius: 6px;
    color: var(--accent-text);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.dfc-howto article p { color: var(--muted); margin: 0; }
.dfc-faq details { margin-top: 14px; }
.dfc-faq summary { cursor: pointer; font-weight: 800; }
.dfc-faq summary::-webkit-details-marker { display: none; }
.dfc-faq summary::before { content: "+"; display: inline-block; margin-right: 10px; transition: transform .2s ease; color: var(--accent); }
.dfc-faq details[open] summary::before { transform: rotate(90deg); }
.dfc-related nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dfc-related a { color: var(--text); text-decoration: none; font-weight: 800; }

.dfc-tool :focus-visible { outline: 3px solid rgba(53, 208, 186, .55); outline-offset: 3px; }

@media (max-width: 980px) {
    .dfc-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .dfc-hero { grid-template-columns: 1fr; padding-top: 36px; }
    .dfc-editor-grid, .dfc-card-grid, .dfc-howto-grid, .dfc-related nav { grid-template-columns: 1fr; }
    .dfc-panel { min-height: 360px; }
    .dfc-tabs { overflow-x: auto; }
    .dfc-tabs button { min-width: 150px; }
    .dfc-status { width: 100%; margin-left: 0; }
    .dfc-toolbar { padding: 14px; }
    .dfc-actions { justify-content: flex-start; }
    .dfc-drop textarea, .dfc-output { padding: 16px 16px 16px 60px; }
    .dfc-ad-banner, .dfc-ad-panel { padding: 16px; }
    .dfc-stats { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .dfc-tool *, .dfc-tool *::before, .dfc-tool *::after {
        transition: none !important;
        animation: none !important;
    }
}
