/* ============================================================
   autocad-browser-dwg-nativo · 1000HW · styles.css · v1
   Cache-bust: ?v=2

   Design system 1000HW (paleta oscura + acento verde ácido).
   Responsive mobile-first. Canvas 2D con grid + snap.
   ============================================================ */

/* --- Design tokens --- */
:root {
    --void: #050505;
    --void-2: #0a0a0a;
    --void-3: #0f0f0f;
    --concrete: #e0e0e0;
    --concrete-2: #b0b0b0;
    --concrete-3: #808080;
    --acid: #ccff00;
    --acid-dim: rgba(204, 255, 0, 0.18);
    --structure: #333333;
    --structure-2: #1a1a1a;
    --danger: #ff5577;
    --danger-dim: rgba(255, 85, 119, 0.18);
    --info: #4aa8ff;
    --info-dim: rgba(74, 168, 255, 0.18);
    --warn: #ffb84a;
    --warn-dim: rgba(255, 184, 74, 0.18);
    --ok: #66dd88;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
    --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    --radius: 6px;
    --radius-lg: 12px;
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.6);
    --transition: 0.18s ease;
}

/* --- Reset / Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--void);
    color: var(--concrete);
    line-height: 1.55;
    min-height: 100vh;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--acid);
    color: var(--void);
}

a {
    color: var(--acid);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover,
a:focus-visible {
    color: var(--concrete);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
canvas:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--acid);
    outline-offset: 2px;
}

button {
    font-family: inherit;
    cursor: pointer;
}

code,
pre {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

img,
svg,
canvas {
    max-width: 100%;
    display: block;
}

/* --- Skip link --- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 8px;
    background: var(--acid);
    color: var(--void);
    padding: 8px 12px;
    border-radius: var(--radius);
    z-index: 100;
    font-weight: 600;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 8px;
}

/* --- Nav --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--structure);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-back {
    color: var(--concrete-2);
    font-size: 0.9rem;
}

.nav-back:hover {
    color: var(--acid);
    text-decoration: none;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    margin-left: auto;
}

.brand-acid {
    color: var(--acid);
}

.nav-toggles {
    display: flex;
    gap: 4px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--structure);
    color: var(--concrete-2);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: all var(--transition);
}

.lang-btn:hover {
    border-color: var(--concrete-3);
    color: var(--concrete);
}

.lang-btn.is-active {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
}

/* --- Container --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Hero --- */
.hero {
    padding: 48px 0 32px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tag-acid {
    background: var(--acid-dim);
    color: var(--acid);
    border: 1px solid rgba(204, 255, 0, 0.3);
}

.tag-priv {
    background: rgba(102, 221, 136, 0.12);
    color: var(--ok);
    border: 1px solid rgba(102, 221, 136, 0.3);
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    line-height: 1.15;
    margin: 0 0 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero h1 .accent {
    color: var(--acid);
}

.hero-lede {
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    color: var(--concrete-2);
    max-width: 720px;
    margin: 0 0 20px;
}

.hero-disclaimer {
    background: var(--void-3);
    border-left: 3px solid var(--acid);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin: 0 0 20px;
    font-size: 0.95rem;
    color: var(--concrete);
    max-width: 920px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--concrete-3);
    font-size: 0.85rem;
}

/* --- Tool section --- */
.tool-section {
    padding: 24px 0 48px;
}

/* --- Dropzone --- */
.dropzone {
    border: 2px dashed var(--structure);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    transition: all var(--transition);
    background: var(--void-2);
    cursor: pointer;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover {
    border-color: var(--acid);
    background: rgba(204, 255, 0, 0.04);
}

.dropzone-icon {
    color: var(--acid);
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.dropzone-text {
    margin: 0 0 4px;
    font-weight: 600;
    color: var(--concrete);
}

.dropzone-text code {
    background: var(--void-3);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--acid);
    font-size: 0.95em;
}

.dropzone-sub {
    margin: 0;
    font-size: 0.85rem;
    color: var(--concrete-3);
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* --- Example button --- */
.example-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all var(--transition);
    text-decoration: none;
    background: transparent;
    color: var(--concrete);
    line-height: 1.2;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
}

.btn-primary:hover {
    background: #d9ff33;
    border-color: #d9ff33;
}

.btn-secondary {
    background: var(--structure);
    color: var(--concrete);
    border-color: var(--structure);
}

.btn-secondary:hover {
    background: #444;
}

.btn-ghost {
    background: transparent;
    color: var(--concrete-2);
    border-color: var(--structure);
}

.btn-ghost:hover {
    border-color: var(--concrete-3);
    color: var(--concrete);
}

.btn-ghost.is-active {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
}

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--void);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.btn-icon {
    padding: 6px 8px;
    min-width: 38px;
    font-weight: 700;
}

/* --- Editor grid --- */
.editor-grid {
    display: grid;
    grid-template-columns: 64px 1fr 240px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "toolbar canvas layers"
        "toolbar canvas layers"
        "toolbar status  status";
    gap: 12px;
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius-lg);
    padding: 12px;
    min-height: 540px;
}

@media (max-width: 900px) {
    .editor-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "toolbar"
            "canvas"
            "layers"
            "status";
    }
}

/* --- Toolbar (left) --- */
.toolbar {
    grid-area: toolbar;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--void-3);
    border-radius: var(--radius);
    padding: 8px;
    align-self: start;
}

@media (max-width: 900px) {
    .toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-self: auto;
    }
}

.tool-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--concrete-2);
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    position: relative;
}

@media (max-width: 900px) {
    .tool-btn {
        width: 44px;
        height: 44px;
    }
}

.tool-btn:hover {
    background: var(--structure-2);
    color: var(--concrete);
}

.tool-btn.is-active {
    background: var(--acid);
    color: var(--void);
}

.tool-btn svg {
    width: 22px;
    height: 22px;
}

.tool-btn .tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--void);
    color: var(--concrete);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 0.78rem;
    white-space: nowrap;
    border: 1px solid var(--structure);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 20;
}

@media (max-width: 900px) {
    .tool-btn .tooltip {
        display: none;
    }
}

.tool-btn:hover .tooltip,
.tool-btn:focus-visible .tooltip {
    opacity: 1;
}

.tool-sep {
    height: 1px;
    background: var(--structure);
    margin: 4px 6px;
}

@media (max-width: 900px) {
    .tool-sep {
        width: 1px;
        height: auto;
        margin: 4px;
    }
}

/* --- Canvas --- */
.canvas-wrap {
    grid-area: canvas;
    background: var(--void);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    min-height: 480px;
}

#drawCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--void);
    cursor: crosshair;
    touch-action: none;
}

.canvas-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--concrete-3);
    text-align: center;
    pointer-events: none;
    padding: 20px;
}

.canvas-empty.is-hidden {
    display: none;
}

.canvas-empty-icon {
    color: var(--concrete-3);
    margin-bottom: 12px;
    opacity: 0.6;
}

.canvas-empty p {
    margin: 0;
    font-size: 0.95rem;
    max-width: 320px;
}

.canvas-tool-cursor {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(5, 5, 5, 0.85);
    color: var(--acid);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-family: var(--font-mono);
    border: 1px solid var(--structure);
    pointer-events: none;
}

.canvas-tool-cursor.is-hidden {
    display: none;
}

/* --- Layers panel (right) --- */
.layers-panel {
    grid-area: layers;
    background: var(--void-3);
    border-radius: var(--radius);
    padding: 12px;
    align-self: start;
}

.layers-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--concrete-3);
    margin: 0 0 10px;
}

.layer-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.layer-item:hover {
    background: var(--structure-2);
}

.layer-item.is-active {
    background: var(--acid-dim);
}

.layer-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid var(--structure);
}

.layer-toggle {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--acid);
    flex-shrink: 0;
}

.layer-name {
    font-size: 0.85rem;
    color: var(--concrete);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-count {
    font-size: 0.75rem;
    color: var(--concrete-3);
    font-family: var(--font-mono);
}

.layer-active-radio {
    accent-color: var(--acid);
    cursor: pointer;
    flex-shrink: 0;
}

/* --- Status bar --- */
.status-bar {
    grid-area: status;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 14px;
    background: var(--void-3);
    border-radius: var(--radius);
    font-size: 0.78rem;
    color: var(--concrete-2);
    font-family: var(--font-mono);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-item strong {
    color: var(--concrete);
}

.status-sep {
    color: var(--structure);
}

/* --- Controls row --- */
.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 14px 0;
    padding: 10px 12px;
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--concrete-2);
}

.control-group label {
    color: var(--concrete-3);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-group select,
.control-group input[type="number"] {
    background: var(--void-3);
    color: var(--concrete);
    border: 1px solid var(--structure);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
}

.control-group select:focus-visible,
.control-group input:focus-visible {
    border-color: var(--acid);
}

.control-group input[type="checkbox"] {
    accent-color: var(--acid);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--concrete-2);
    font-size: 0.85rem;
}

/* --- Export row --- */
.export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
}

.export-label {
    font-size: 0.78rem;
    color: var(--concrete-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
}

.btn-export {
    background: var(--structure-2);
    color: var(--concrete);
    border: 1px solid var(--structure);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.btn-export:hover {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
}

.btn-export:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Inline notice --- */
.inline-notice {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.inline-notice.is-error {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.inline-notice.is-warn {
    background: var(--warn-dim);
    color: var(--warn);
    border: 1px solid var(--warn);
}

.inline-notice.is-info {
    background: var(--info-dim);
    color: var(--info);
    border: 1px solid var(--info);
}

.inline-notice.is-ok {
    background: rgba(102, 221, 136, 0.12);
    color: var(--ok);
    border: 1px solid var(--ok);
}

.inline-notice.is-hidden {
    display: none;
}

/* --- Content sections (long copy) --- */
.content-section {
    padding: 48px 0;
    border-top: 1px solid var(--structure);
}

.content-section h2 {
    font-size: clamp(1.4rem, 3.2vw, 1.8rem);
    margin: 32px 0 12px;
    color: var(--concrete);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section h3 {
    font-size: 1.1rem;
    margin: 24px 0 10px;
    color: var(--acid);
    font-weight: 600;
}

.content-section p {
    margin: 0 0 12px;
    color: var(--concrete-2);
    max-width: 820px;
}

.content-section strong {
    color: var(--concrete);
}

.content-list {
    padding-left: 20px;
    margin: 0 0 20px;
    color: var(--concrete-2);
    max-width: 820px;
}

.content-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.callout {
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0;
    max-width: 920px;
}

.callout-priv {
    background: var(--void-3);
    border-left: 3px solid var(--acid);
}

.callout-warn {
    background: rgba(255, 184, 74, 0.06);
    border-left: 3px solid var(--warn);
}

.callout h3 {
    margin: 0 0 10px;
    color: var(--concrete);
    font-size: 1rem;
}

.callout p,
.callout li {
    color: var(--concrete-2);
    font-size: 0.92rem;
    margin: 0 0 8px;
}

/* --- FAQ --- */
.faq-list {
    max-width: 820px;
}

.faq-item {
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: border-color var(--transition);
}

.faq-item[open] {
    border-color: var(--acid);
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--concrete);
    padding: 4px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: "▸";
    color: var(--acid);
    transition: transform var(--transition);
    display: inline-block;
}

.faq-item[open] summary::before {
    transform: rotate(90deg);
}

.faq-item p {
    margin: 10px 0 0;
    color: var(--concrete-2);
    line-height: 1.6;
}

/* --- Glossary --- */
.glossary {
    max-width: 820px;
    margin: 0;
}

.glossary dt {
    font-weight: 600;
    color: var(--concrete);
    margin-top: 14px;
}

.glossary dd {
    color: var(--concrete-2);
    margin-left: 0;
    margin-bottom: 6px;
    line-height: 1.6;
}

.glossary code {
    background: var(--void-3);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--acid);
}

/* --- Footer --- */
.footer {
    padding: 24px 0 32px;
    border-top: 1px solid var(--structure);
    color: var(--concrete-3);
    font-size: 0.82rem;
    text-align: center;
}

.footer p {
    margin: 0 0 4px;
}

.footer-fine {
    color: var(--concrete-3);
}

/* --- Offline banner --- */
.offline-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    background: var(--acid);
    color: var(--void);
    padding: 10px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100% - 24px);
    animation: slideDown 0.3s ease-out;
}

.offline-banner[hidden] {
    display: none;
}

.offline-icon {
    font-size: 1.1rem;
}

.offline-dismiss {
    background: transparent;
    border: none;
    color: var(--void);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* --- Donation toast --- */
.donation-toast {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 30;
    background: var(--void-3);
    border: 1px solid var(--structure);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideUp 0.3s ease-out;
}

.donation-toast[hidden] {
    display: none;
}

.donation-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.donation-icon {
    color: var(--acid);
    flex-shrink: 0;
}

.donation-content {
    flex: 1;
}

.donation-title {
    margin: 0 0 2px;
    font-weight: 600;
    color: var(--concrete);
    font-size: 0.92rem;
}

.donation-sub {
    margin: 0;
    font-size: 0.78rem;
    color: var(--concrete-2);
    line-height: 1.4;
}

.donation-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.donation-cta {
    background: var(--acid);
    color: var(--void);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.78rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: background var(--transition);
}

.donation-cta:hover {
    background: #d9ff33;
    text-decoration: none;
}

.donation-dismiss {
    background: transparent;
    border: 1px solid var(--structure);
    color: var(--concrete-2);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 600;
}

.donation-dismiss:hover {
    border-color: var(--concrete-3);
    color: var(--concrete);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Modal dialog --- */
.confirm-dialog {
    background: var(--void-2);
    color: var(--concrete);
    border: 1px solid var(--acid);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.confirm-dialog-form {
    padding: 22px 24px;
}

.confirm-dialog-title {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: var(--concrete);
}

.confirm-dialog-desc {
    margin: 0 0 6px;
    color: var(--concrete-2);
    font-size: 0.9rem;
}

.confirm-dialog-warn {
    margin: 0 0 16px;
    color: var(--warn);
    font-size: 0.85rem;
}

.confirm-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* --- Text input modal --- */
.text-dialog {
    background: var(--void-2);
    color: var(--concrete);
    border: 1px solid var(--acid);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.text-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.text-dialog-form {
    padding: 22px 24px;
}

.text-dialog-title {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: var(--concrete);
}

.text-dialog-desc {
    margin: 0 0 12px;
    color: var(--concrete-2);
    font-size: 0.9rem;
}

.text-dialog-input {
    width: 100%;
    background: var(--void-3);
    color: var(--concrete);
    border: 1px solid var(--structure);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.text-dialog-input:focus-visible {
    border-color: var(--acid);
    outline: 2px solid var(--acid);
    outline-offset: 2px;
}

.text-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* --- Layer dialog --- */
.layer-dialog {
    background: var(--void-2);
    color: var(--concrete);
    border: 1px solid var(--acid);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.layer-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.layer-dialog-form {
    padding: 22px 24px;
}

.layer-dialog-title {
    margin: 0 0 14px;
    font-size: 1.1rem;
    color: var(--concrete);
}

.layer-dialog-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.layer-dialog-row label {
    font-size: 0.85rem;
    color: var(--concrete-2);
    min-width: 60px;
}

.layer-dialog-row input[type="text"] {
    flex: 1;
    background: var(--void-3);
    color: var(--concrete);
    border: 1px solid var(--structure);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
}

.layer-dialog-row input[type="color"] {
    width: 50px;
    height: 32px;
    background: var(--void-3);
    border: 1px solid var(--structure);
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
}

.layer-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* --- Visually hidden --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Responsive adjustments --- */
@media (max-width: 640px) {
    .hero {
        padding: 32px 0 20px;
    }

    .hero-tags {
        gap: 4px;
    }

    .nav-inner {
        padding: 10px 14px;
    }

    .container {
        padding: 0 14px;
    }

    .editor-grid {
        padding: 8px;
    }

    .donation-toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .export-row,
    .controls-row {
        gap: 6px;
    }

    .btn-export {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
}
/* ============================================================
   v2 (2026-07-02): Cad-* component classes for autocad-browser-dwg-nativo.
   The legacy styles.css had .toolbar/.dropzone/.btn classes (a different design
   template) but the HTML used .cad-* classes. This block adds the missing CSS
   for the actual classes used in the regenerated HTML, so the editor renders
   correctly even if Tailwind JIT misses a rule.
   ============================================================ */

/* --- Tool hero --- */
.tool-hero {
    padding: 32px 0 24px;
    max-width: 1280px;
    margin: 0 auto;
}
.tool-hero__cat {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--acid-dim);
    color: var(--acid);
    border: 1px solid rgba(204, 255, 0, 0.3);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.tool-hero__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.15;
    margin: 0 0 14px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--concrete);
}
.tool-hero__lead {
    color: var(--concrete-2);
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 720px;
    margin: 0 0 18px;
}
.tool-hero__ctas {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- Cad app (editor) --- */
.cad-app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 24px;
}
.cad-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.cad-toolbar__group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cad-toolbar__group--inline {
    gap: 8px;
}
.cad-toolbar__divider {
    width: 1px;
    height: 24px;
    background: var(--structure);
}
.cad-toolbar__spacer {
    flex: 1;
}
.cad-toolbar__label {
    color: var(--concrete-3);
    font-size: 0.78rem;
    margin-right: 4px;
}
.cad-toolbar__check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--concrete-2);
    font-size: 0.85rem;
    cursor: pointer;
}
.cad-color {
    width: 32px;
    height: 28px;
    border: 1px solid var(--structure);
    background: var(--void-2);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}
.cad-range {
    width: 80px;
    accent-color: var(--acid);
}
.cad-input {
    background: var(--void-2);
    border: 1px solid var(--structure);
    color: var(--concrete);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
}
.cad-input--mini {
    width: 60px;
}

/* --- Cad button --- */
.cad-btn {
    background: var(--void-2);
    color: var(--concrete);
    border: 1px solid var(--structure);
    padding: 7px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cad-btn:hover {
    border-color: var(--concrete-3);
    color: var(--concrete);
}
.cad-btn:focus-visible {
    outline: 2px solid var(--acid);
    outline-offset: 2px;
}
.cad-btn--icon {
    padding: 7px 10px;
}
.cad-btn--mini {
    padding: 4px 8px;
    font-size: 0.8rem;
}
.cad-btn--block {
    width: 100%;
    justify-content: center;
}
.cad-btn--primary {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
    font-weight: 700;
}
.cad-btn--primary:hover {
    background: #d9ff33;
    border-color: #d9ff33;
    color: var(--void);
}
.cad-btn--ghost {
    background: transparent;
    border-color: var(--concrete-3);
}
.cad-btn--tool {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    font-size: 1rem;
    font-family: var(--font-mono);
}
.cad-btn--tool.active {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
}
.cad-tool-glyph {
    font-family: var(--font-mono);
    font-weight: 700;
}
.cad-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.cad-floating-btn {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--acid);
    color: var(--void);
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 10;
}
.cad-fmt-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--void-3);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--concrete);
}
.cad-fmt-tag--accent {
    background: var(--acid-dim);
    color: var(--acid);
}

/* --- Cad body layout --- */
.cad-body {
    display: grid;
    grid-template-columns: 200px 1fr 240px;
    gap: 0;
    margin-top: 12px;
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 540px;
}
.cad-side {
    background: var(--void-2);
    overflow-y: auto;
}
.cad-side--left {
    border-right: 1px solid var(--structure);
}
.cad-side--right {
    border-left: 1px solid var(--structure);
}
.cad-side__inner {
    padding: 14px 12px;
}
.cad-side__title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--concrete-3);
    margin: 0 0 8px;
}
.cad-side__title--mt {
    margin-top: 16px;
}

/* --- Canvas --- */
.cad-canvas-wrap {
    position: relative;
    background: var(--canvas-bg, var(--void-3));
    overflow: hidden;
}
.cad-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}
.cad-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, 0.85);
    z-index: 5;
}
.cad-empty__inner {
    text-align: center;
    max-width: 360px;
    padding: 24px;
}
.cad-empty__icon {
    color: var(--acid);
    margin-bottom: 12px;
}
.cad-empty__title {
    font-size: 1.3rem;
    color: var(--concrete);
    margin: 0 0 8px;
}
.cad-empty__text {
    color: var(--concrete-2);
    font-size: 0.95rem;
    margin: 0 0 8px;
}
.cad-empty__hint {
    color: var(--concrete-3);
    font-size: 0.85rem;
    margin: 0 0 16px;
}
.cad-empty__ctas {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Side hints --- */
.cad-tip {
    background: var(--void-3);
    border-left: 3px solid var(--acid);
    padding: 10px 12px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 14px;
}
.cad-tip__label {
    display: block;
    color: var(--acid);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.cad-tip__text {
    color: var(--concrete);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}
.cad-shortcuts {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: var(--concrete-2);
}
.cad-shortcuts li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}
.cad-shortcuts kbd {
    background: var(--void-3);
    border: 1px solid var(--structure);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--concrete);
}

/* --- Status --- */
.cad-status {
    font-size: 0.85rem;
    color: var(--concrete-2);
}
.cad-status__row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed var(--structure-2);
}
.cad-status__row:last-child {
    border-bottom: none;
}
.cad-status__label {
    color: var(--concrete-3);
}
.cad-status__value {
    color: var(--concrete);
    font-family: var(--font-mono);
}

/* --- Layers --- */
.cad-layers-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.cad-layers {
    list-style: none;
    padding: 0;
    margin: 0;
}
.cad-layer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--void-3);
    border: 1px solid var(--structure-2);
    border-radius: var(--radius);
    margin-bottom: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}
.cad-layer.active {
    border-color: var(--acid);
    background: var(--acid-dim);
}
.cad-layer__swatch {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}
.cad-layer__name {
    flex: 1;
    color: var(--concrete);
}
.cad-layer__btn {
    background: transparent;
    border: none;
    color: var(--concrete-3);
    cursor: pointer;
    padding: 0 4px;
    font-size: 0.9rem;
}
.cad-layer__btn:hover {
    color: var(--acid);
}
.cad-layer__btn--vis.is-off {
    color: var(--concrete-3);
    opacity: 0.5;
}

/* --- View controls --- */
.cad-view-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* --- Formats tags --- */
.cad-formats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cad-tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--acid-dim);
    color: var(--acid);
    border: 1px solid rgba(204, 255, 0, 0.3);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
}
.cad-tag--warn {
    background: var(--warn-dim);
    color: var(--warn);
    border-color: rgba(255, 184, 74, 0.3);
}

/* --- Privacy inline --- */
.cad-privacy-inline {
    margin: 12px 0 0;
    padding: 10px 14px;
    background: var(--void-2);
    border-left: 3px solid var(--ok);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--concrete-2);
    font-size: 0.88rem;
    text-align: center;
}

/* --- Prose block & long content --- */
.prose-block,
.long-content {
    max-width: 880px;
    margin: 32px auto;
    padding: 0 20px;
    color: var(--concrete-2);
    line-height: 1.65;
}
.prose-block h2,
.long-content h2 {
    color: var(--concrete);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 32px 0 14px;
    letter-spacing: -0.01em;
}
.prose-block h3,
.long-content h3 {
    color: var(--concrete);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 24px 0 10px;
}
.prose-block p,
.long-content p {
    margin: 0 0 14px;
}
.prose-block ul,
.prose-block ol,
.long-content ul,
.long-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}
.prose-block li,
.long-content li {
    margin-bottom: 6px;
}
.prose-block a,
.long-content a {
    color: var(--acid);
    text-decoration: none;
    border-bottom: 1px solid rgba(204, 255, 0, 0.4);
}
.prose-block a:hover,
.long-content a:hover {
    border-bottom-color: var(--acid);
}
.prose-block details,
.long-content details {
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
}
.prose-block summary,
.long-content summary {
    cursor: pointer;
    color: var(--concrete);
    font-weight: 600;
    padding: 4px 0;
}
.prose-block summary:hover,
.long-content summary:hover {
    color: var(--acid);
}
.prose-block details p,
.long-content details p {
    margin: 10px 0 0;
    color: var(--concrete-2);
}

/* --- Glossary --- */
.glossary {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.glossary dt {
    color: var(--acid);
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 8px;
}
.glossary dd {
    color: var(--concrete-2);
    margin: 0 0 0 14px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.glossary code {
    background: var(--void-3);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--concrete);
}

/* --- Site nav --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--structure);
}
.site-nav {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.site-nav__back {
    color: var(--concrete-2);
    text-decoration: none;
    font-size: 0.9rem;
}
.site-nav__back:hover {
    color: var(--acid);
}
.site-nav__brand {
    font-weight: 700;
    font-size: 1.05rem;
    margin-left: auto;
    color: var(--concrete);
}
.site-nav__toggles {
    display: flex;
    gap: 4px;
}

/* --- Site main --- */
.site-main {
    flex: 1;
}

/* --- Site footer --- */
.site-footer {
    margin-top: 32px;
    padding: 28px 20px;
    background: var(--void-2);
    border-top: 1px solid var(--structure);
    text-align: center;
    color: var(--concrete-3);
    font-size: 0.88rem;
}
.site-footer p {
    margin: 4px 0;
}
.site-footer a {
    color: var(--concrete-2);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--acid);
}
.site-footer__small {
    font-size: 0.78rem;
    color: var(--concrete-3);
}

/* --- DWG notice --- */
.dwg-notice {
    max-width: 880px;
    margin: 0 auto 24px;
    padding: 0 20px;
}
.dwg-notice[hidden] {
    display: none;
}
.dwg-notice__inner {
    background: var(--warn-dim);
    border: 1px solid rgba(255, 184, 74, 0.4);
    border-left: 4px solid var(--warn);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.dwg-notice__icon {
    color: var(--warn);
    font-size: 1.4rem;
    line-height: 1;
}
.dwg-notice__body {
    flex: 1;
}
.dwg-notice__title {
    margin: 0 0 4px;
    color: var(--warn);
    font-size: 0.95rem;
    font-weight: 700;
}
.dwg-notice__text {
    margin: 0;
    color: var(--concrete-2);
    font-size: 0.88rem;
    line-height: 1.45;
}
.dwg-notice__close {
    background: transparent;
    border: 1px solid var(--warn);
    color: var(--warn);
    padding: 5px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    align-self: center;
    white-space: nowrap;
}
.dwg-notice__close:hover {
    background: var(--warn);
    color: var(--void);
}

/* --- Confirm modal --- */
.confirm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.confirm-modal[hidden] {
    display: none;
}
.confirm-modal__card {
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.confirm-modal__title {
    margin: 0 0 10px;
    color: var(--concrete);
    font-size: 1.1rem;
    font-weight: 700;
}
.confirm-modal__message {
    margin: 0 0 18px;
    color: var(--concrete-2);
    line-height: 1.5;
}
.confirm-modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* --- Mobile responsive --- */
@media (max-width: 1024px) {
    .cad-body {
        grid-template-columns: 160px 1fr 200px;
    }
}
@media (max-width: 768px) {
    .cad-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    .cad-side {
        max-height: 160px;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--structure);
    }
    .cad-side--right {
        border-bottom: none;
        border-top: 1px solid var(--structure);
    }
    .tool-hero {
        padding: 20px 16px 16px;
    }
    .cad-app {
        padding: 0 12px 16px;
    }
    .cad-toolbar {
        padding: 8px;
        gap: 6px;
    }
    .tool-hero__title {
        font-size: 1.5rem;
    }
    .dwg-notice__inner {
        flex-direction: column;
    }
}
@media (max-width: 480px) {
    .cad-toolbar__divider {
        display: none;
    }
}
