/* HTML Email CSS Inliner — style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #07090f;
    --bg2: #0f1624;
    --bg3: #161f30;
    --border: #1c2a3f;
    --border2: rgba(99, 102, 241, 0.18);
    --text: #e8eaf6;
    --text2: #8f9bc5;
    --text3: #3d4a6a;
    --g1: #6366f1;
    --g2: #a855f7;
    --g3: #ec4899;
    --green: #4ade80;
    --red: #f87171;
    --radius: 12px;
    --t: all 0.18s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 50% 35% at 15% 5%, rgba(99, 102, 241, 0.08), transparent), radial-gradient(ellipse 40% 25% at 85% 85%, rgba(236, 72, 153, 0.06), transparent);
    z-index: 0;
}

/* Header */
header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 9, 15, 0.9);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 50;
}

.header-wrap {
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--g1), var(--g3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
}

h1.brand-name {
    display: inline;
}

.brand-sub {
    font-size: 10px;
    color: var(--text3);
}

.header-actions {
    display: flex;
    gap: 6px;
}

/* Workspace */
.workspace {
    display: grid;
    grid-template-columns: 1fr 160px 1fr;
    flex: 1;
    gap: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Panels */
.panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.panel-right {
    border-right: none;
}

.panel-header {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text2);
}

.code-area {
    flex: 1;
    background: #050710;
    color: #e2e8f0;
    border: none;
    resize: none;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    outline: none;
    width: 100%;
    height: 100%;
    tab-size: 2;
}

.code-area::placeholder {
    color: #2a3550;
}

.char-count {
    font-size: 10px;
    color: var(--text3);
    font-family: 'JetBrains Mono', monospace;
}

/* Controls */
.controls-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 8px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.controls-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ctrl-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text3);
    margin-bottom: 2px;
}

.opt-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text2);
    cursor: pointer;
}

.opt-row input[type="checkbox"] {
    accent-color: var(--g1);
    width: 13px;
    height: 13px;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--t);
    white-space: nowrap;
}

.btn:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

.btn-sm {
    padding: 4px 9px;
    font-size: 11px;
    border-radius: 6px;
}

.btn-primary {
    background: none;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 10px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--g1), var(--g2), var(--g3));
    z-index: -1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: var(--bg2);
    z-index: -1;
}

.btn-primary:hover::after {
    background: rgba(99, 102, 241, 0.2);
}

.btn-inline {
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    font-size: 13px;
}

.btn-arrow {
    font-size: 20px;
    line-height: 1;
}

/* Stats */
.stats-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-label {
    font-size: 10px;
    color: var(--text3);
}

.stat-val {
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.green {
    color: var(--green);
}

/* View toggle */
.preview-toggle {
    display: flex;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 4px;
}

.view-btn {
    flex: 1;
    padding: 5px 4px;
    font-size: 10px;
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    transition: var(--t);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.view-btn.active {
    background: var(--g1);
    color: #fff;
}

/* Panes */
.pane {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.pane.active {
    display: flex;
}

/* Diff view */
.diff-container {
    flex: 1;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    overflow-y: auto;
    background: #050710;
    line-height: 1.7;
}

.diff-add {
    color: var(--green);
    background: rgba(74, 222, 128, 0.06);
}

.diff-del {
    color: var(--red);
    background: rgba(248, 113, 113, 0.06);
    text-decoration: line-through;
    opacity: 0.7;
}

.diff-same {
    color: var(--text3);
}

/* Output status */
.output-status {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
}

.output-status.ok {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
}

.output-status.err {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
}

/* Toast */
.toast-wrap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text);
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.22s ease;
    pointer-events: all;
}

.toast.show {
    transform: none;
    opacity: 1;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

@media(max-width:768px) {
    .workspace {
        grid-template-columns: 1fr;
        height: auto;
        overflow: auto;
    }

    body {
        height: auto;
        overflow: auto;
    }
}