*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #f3f4ff 0, #f9fafb 40%, #fefefe 100%);
    color: #111827;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

.dm-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.55);
}

.dm-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.dm-logo-main {
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.dm-logo-sub {
    font-size: 0.7rem;
    color: #9ca3af;
}

.dm-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.dm-nav a {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.dm-nav a:hover {
    background: rgba(148, 163, 184, 0.25);
    transform: translateY(-1px);
}

.dm-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    color: #f9fafb;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.45);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.dm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.6);
    filter: brightness(1.03);
}

.dm-btn-outlined {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    font-size: 0.85rem;
}

.dm-btn-ghost {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 0.9rem;
    background: transparent;
}

.dm-btn-full {
    width: 100%;
    text-align: center;
}

.dm-btn-small {
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.03);
}

.dm-btn-danger {
    border-color: rgba(248, 113, 113, 0.8);
    color: #b91c1c;
}

.dm-main {
    flex: 1;
    padding: 1.5rem 1.25rem 2.5rem;
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
}

.dm-footer {
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    text-align: center;
    color: #6b7280;
    border-top: 1px solid rgba(209, 213, 219, 0.6);
    background: #f9fafb;
}

.dm-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
    margin-top: 0.8rem;
    margin-bottom: 2.2rem;
}

.dm-hero-text h1 {
    font-size: clamp(1.85rem, 2.2vw + 1rem, 2.6rem);
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.dm-hero-text p {
    font-size: 0.95rem;
    color: #4b5563;
    max-width: 32rem;
}

.dm-hero-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dm-hero-preview {
    display: flex;
    justify-content: center;
}

.dm-ad-card {
    background: #f9fafb;
    border-radius: 1.1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 240px;
    max-width: 320px;
    animation: floatIn 0.7s ease-out;
}

.dm-ad-card.demo {
    transform: rotate(-3deg) translateY(8px);
    animation: floatSoft 3s ease-in-out infinite alternate;
}

@keyframes floatSoft {
    from { transform: rotate(-3deg) translateY(8px); }
    to { transform: rotate(-1deg) translateY(0); }
}

.dm-ad-card-own {
    border-style: dashed;
}

.dm-ad-card h3 {
    font-size: 1rem;
}

.dm-ad-card p {
    font-size: 0.86rem;
    color: #374151;
}

.dm-ad-tag {
    align-self: flex-start;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.06);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.dm-ad-price {
    font-size: 0.86rem;
    font-weight: 600;
    color: #16a34a;
}

.dm-ad-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #6b7280;
}

.dm-ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6b7280;
}

.dm-ad-actions {
    display: flex;
    gap: 0.4rem;
}

.dm-section {
    margin-top: 1.5rem;
}

.dm-section-header {
    margin-bottom: 1rem;
}

.dm-section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.dm-section-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.dm-section-header p {
    font-size: 0.9rem;
    color: #6b7280;
}

.dm-ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.dm-auth {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 1.5rem;
}

.dm-auth-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1.2rem;
    padding: 1.5rem 1.7rem;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(209, 213, 219, 0.8);
}

.dm-auth-card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.dm-auth-card p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.8rem;
}

.dm-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.dm-form label {
    font-size: 0.8rem;
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dm-form input,
.dm-form select,
.dm-form textarea {
    border-radius: 0.7rem;
    border: 1px solid rgba(209, 213, 219, 0.9);
    padding: 0.5rem 0.6rem;
    font-size: 0.88rem;
    outline: none;
    background: #f9fafb;
    transition: border 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dm-form input:focus,
.dm-form select:focus,
.dm-form textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.3);
    background: #ffffff;
}

.dm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.6rem;
}

.dm-auth-switch {
    margin-top: 0.7rem;
    font-size: 0.8rem;
    text-align: center;
}

.dm-auth-switch a {
    color: #4f46e5;
    font-weight: 500;
}

.dm-alert {
    border-radius: 0.75rem;
    padding: 0.65rem 0.8rem;
    font-size: 0.78rem;
    margin-bottom: 0.8rem;
}

.dm-alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.dm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dm-filter-bar select,
.dm-filter-bar input {
    border-radius: 999px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    padding: 0.35rem 0.7rem;
    font-size: 0.84rem;
    background: #fff;
}

.dm-ad-builder {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: flex-start;
}

.dm-ad-live-preview {
    background: radial-gradient(circle at top left, #e0f2fe, #f5f3ff 40%, #f9fafb 100%);
    border-radius: 1.25rem;
    padding: 0.9rem;
    border: 1px dashed rgba(148, 163, 184, 0.8);
}

.dm-ad-live-preview h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.dm-ad-preview-card {
    margin-top: 0.3rem;
}

.dm-main {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 800px) {
    .dm-main {
        padding-inline: 1rem;
    }
    .dm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    .dm-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .dm-hero {
        grid-template-columns: minmax(0, 1fr);
    }
    .dm-hero-preview {
        order: -1;
        margin-bottom: 0.5rem;
    }
    .dm-ad-builder {
        grid-template-columns: minmax(0, 1fr);
    }
}
