:root {
    font-family: 'Roboto', sans-serif;
    color: #222;
    background: #f5f7fa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f5f7fa;
}

.print-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.print-header .print-label {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.print-header h1 {
    margin: 0 0 8px;
    font-size: 1.8rem;
}

.print-header p {
    margin: 4px 0;
    color: #555;
}

.print-panel,
.print-preview {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.print-section {
    margin-bottom: 18px;
}

.print-section h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #222;
}

.print-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #333;
}

.print-section input[type="text"],
.print-section select {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid #d2d8df;
    border-radius: 8px;
    background: #fff;
    font-size: 0.95rem;
    margin-top: 6px;
}

.print-section small {
    display: block;
    color: #777;
    margin-top: 6px;
}

.print-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.button {
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0,0,0,0.08);
}

.button.primary {
    background: #1877f2;
    color: white;
}

.button.secondary {
    background: #f0f2f5;
    color: #333;
}

.print-preview .preview-header {
    margin-bottom: 18px;
}

.print-preview .preview-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.print-preview .preview-header p {
    margin: 8px 0 0;
    color: #666;
}

.list-print {
    min-height: 420px;
    overflow: auto;
    padding: 24px;
    background: #fbfcfe;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.list-layout {
    width: 100%;
    font-family: "Courier New", Consolas, monospace;
}

.list-layout.horizontal {
    column-width: 420px;
    column-gap: 18px;
}

.list-layout.vertical {
    max-width: 900px;
}

.tree-text {
    margin: 0;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: #111111;
    white-space: pre;
    font-weight: 700;
}

.print-error {
    color: #b92f2f;
    font-weight: 500;
    margin-top: 12px;
}

@media print {
    @page {
        margin-top: 0.8in;
        margin-left: 0.8in;
        margin-right: 0.4in;
        margin-bottom: 0.4in;
    }

    body,
    .print-shell {
        background: #ffffff;
        margin: 0;
        padding: 0;
    }

    .print-panel,
    .print-header,
    .print-buttons,
    .print-actions-top,
    #print-error {
        display: none !important;
    }

    .print-preview {
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
        background: #ffffff;
    }

    .preview-header {
        display: block !important;
        margin-bottom: 12px;
    }

    .preview-header h2,
    .preview-header p {
        margin-left: 0;
    }

    .list-print {
        border: none;
        box-shadow: none;
        padding: 0;
        background: #ffffff;
        min-height: 0;
        overflow: visible;
    }

    .tree-text {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .list-layout.horizontal {
        column-width: 300px;
    }
}
