* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #121212;
    color: #fff;
    padding: 20px;
}
h1 {
    text-align: center;
    margin: 20px 0 6px;
    font-weight: 500;
}
.sub {
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 24px;
}
.app-container {
    width: 100%;
    max-width: none;
    margin: 0;
}
.menu-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}
.menu-card {
    background: #1e1e1e;
    border: 2px solid #2a2a2a;
    border-radius: 16px;
    padding: 24px 28px;
    width: 100%;
    max-width: 480px;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 18px;
}
.menu-card:hover {
    border-color: #4caf50;
    background: #252525;
    transform: translateY(-2px);
}
.menu-card-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}
.menu-card-text h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 600;
}
.menu-card-text p {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.4;
}
.viewonly-banner {
    background: #2a2a1e;
    border-left: 4px solid #ff9800;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
}
.viewonly-banner.visible {
    display: flex;
}
.viewonly-banner button {
    background: transparent;
    border: 1px solid #ff9800;
    color: #ff9800;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.15s;
    white-space: nowrap;
}
.viewonly-banner button:hover {
    background: #ff9800;
    color: #111;
}
.btn {
    background-color: #2c2c2c;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:hover {
    background-color: #3d3d3d;
}
.btn-primary {
    background: #4caf50;
    border-color: #4caf50;
}
.btn-primary:hover {
    background: #66bb6a;
}
.btn-danger {
    background: #b71c1c;
    border-color: #b71c1c;
}
.btn-danger:hover {
    background: #d32f2f;
}
.btn-share {
    background: #1976d2;
    border-color: #1976d2;
}
.btn-share:hover {
    background: #2196f3;
}
.btn-capture {
    background: #7b1fa2;
    border-color: #7b1fa2;
}
.btn-capture:hover {
    background: #9c27b0;
}
.screen {
    display: none;
}
.screen.active {
    display: block;
}
.board-title-wrap {
    max-width: 720px;
    margin: 0 auto 16px auto;
    text-align: center;
}
.board-title-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #2a2a2a;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    text-align: center;
    padding: 10px 4px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.board-title-input:focus {
    border-bottom-color: #4caf50;
}
.board-title-input::placeholder {
    color: #444;
    font-style: italic;
    font-weight: 400;
}
.language-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    color: #aaa;
}
.language-bar select {
    background: #2c2c2c;
    border: 1px solid #3d3d3d;
    color: #fff;
    padding: 6px 12px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}
.create-panel {
    background: #1e1e1e;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}
.form-group label {
    font-size: 0.85rem;
    color: #aaa;
    font-weight: 500;
}
.form-group input,
.form-group select {
    background: #2c2c2c;
    border: 1px solid #3d3d3d;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
}
.form-group input:focus,
.form-group select:focus {
    border-color: #4caf50;
}
.create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.builder-section {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #262626;
    margin-bottom: 16px;
}
.builder-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2e2e2e;
}
.builder-year-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4caf50;
    background: #2a2a2a;
    padding: 4px 16px;
    border-radius: 20px;
}
.builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.builder-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 700px;
    margin: 0 auto;
}
.builder-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 900px;
    margin: 0 auto;
}
.card-base {
    background: #202020;
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    min-height: 150px;
    justify-content: flex-start;
}
.builder-cell {
    transition: 0.15s;
    cursor: default;
    user-select: none;
}
.builder-cell:focus-within {
    border-color: #4caf50;
    background: #252525;
    z-index: 10;
}
.builder-cell img.cover {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #2a2a2a;
    transition: transform 0.2s ease;
}
.builder-cell .placeholder-cover {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 1.4rem;
}
.builder-cell-input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    outline: none;
    width: 100%;
    font-family: inherit;
    word-break: break-word;
    position: absolute;
    inset: auto 8px 8px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    background: transparent;
    border-radius: 6px;
    padding: 2px 0;
}
.builder-cell-input::placeholder {
    color: #555;
    font-style: italic;
}
.builder-cell-input.active {
    opacity: 1;
    pointer-events: auto;
    height: auto;
    width: auto;
    background: #2c2c2c;
    padding: 6px 8px;
}
.builder-cell-slot {
    position: absolute;
    top: 6px;
    left: 10px;
    font-size: 0.65rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cell-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
}
.cell-suggestions.open {
    display: block;
}
.cell-suggestions.below {
    top: 100%;
    margin-top: 4px;
}
.cell-suggestions.above {
    bottom: 100%;
    margin-bottom: 4px;
}
.cell-suggestion-item {
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-bottom: 1px solid #252525;
    font-size: 0.8rem;
    text-align: left;
}
.cell-suggestion-item:last-child {
    border-bottom: none;
}
.cell-suggestion-item:hover {
    background: #2a2a2a;
}
.cell-suggestion-item img {
    width: 28px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    background: #2a2a2a;
    flex-shrink: 0;
}
.cell-suggestion-text {
    flex: 1;
    overflow: hidden;
}
.cell-suggestion-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}
.cell-suggestion-meta {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
}
.cell-suggestions .loading,
.cell-suggestions .empty {
    padding: 10px;
    text-align: center;
    color: #777;
    font-size: 0.8rem;
    font-style: italic;
}
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    background: #181818;
    padding: 14px 20px;
    margin-bottom: 24px;
    justify-content: center;
    border: 1px solid #262626;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}
.stat-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}
.green-bg {
    background: #4caf50;
}
.orange-bg {
    background: #ff9800;
}
.red-bg {
    background: #f44336;
}
.white-bg {
    background: #f5f5f5;
}
.stat-value {
    font-weight: 700;
    margin-left: 4px;
}
.counter-sticky .counter-sticky-checklist {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #222;
    color: #fff;
    padding: 10px 14px;
    font-size: clamp(13px, 3.5vw, 18px);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
    user-select: none;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 16px;
}
.viewonly-csv-grid {
    display: grid;
    grid-template-columns: 1fr repeat(12, 1fr);
    gap: 6px;
    margin-bottom: 4px;
    width: 100%;
}
@media (max-width: 1300px) {
    .viewonly-csv-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
.viewonly-csv-label {
    grid-column: span 1;
    background-color: #333;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.85rem;
}
.viewonly-csv-cell {
    background-color: #1e1e1e;
    color: #fff;
    border: none;
    font-size: clamp(9px, 1.8vw, 13px);
    padding: 6px 4px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}
.viewonly-csv-cell img {
    width: 48px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}
@media (max-width: 480px) {
    .viewonly-csv-cell img {
        width: 32px;
        height: 44px;
    }
}
.viewonly-csv-cell span {
    font-size: 0.75rem;
    line-height: 1.2;
}
.viewonly-csv-cell.green {
    background-color: #4caf50;
}
.viewonly-csv-cell.orange {
    background-color: #ff9800;
}
.viewonly-csv-cell.red {
    background-color: #f44336;
}
.viewonly-csv-cell.white {
    background-color: #f5f5f5;
    color: #000;
}
.grid-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.grid-row {
    display: grid;
    gap: 12px;
}
.grid-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
    max-width: 700px;
    margin: 0 auto;
}
.grid-row.cols-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 900px;
    margin: 0 auto;
}
.static-grid-section {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #262626;
    max-width: 960px;
    margin: 0 auto;
}
.anime-card {
    cursor: pointer;
    transition: all 0.15s;
}
.anime-card:hover {
    transform: translateY(-2px);
    border-color: #444;
}
.anime-card.green {
    background: #2e7d32;
    border-color: #4caf50;
}
.anime-card.orange {
    background: #b85e00;
    border-color: #ff9800;
}
.anime-card.red {
    background: #a12b2b;
    border-color: #f44336;
}
.anime-card.white {
    background: #e0e0e0;
    color: #111;
    border-color: #fff;
}
.anime-card.white .anime-meta {
    color: #333;
}
.anime-card img {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #2a2a2a;
    transition: transform 0.2s ease;
}
.anime-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}
.anime-meta {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 4px;
}
.empty-placeholder {
    color: #555;
    font-style: italic;
    font-size: 0.85rem;
}
.anime-card.viewonly:hover {
    transform: none;
}
.anime-card:hover img,
.builder-cell:hover img.cover,
.csv-cell:hover img,
.viewonly-csv-cell:hover img {
    transform: scale(1.05);
}
body.ctrl-held .anime-card:hover img,
body.ctrl-held .builder-cell:hover img.cover,
body.ctrl-held .csv-cell:hover img,
body.ctrl-held .viewonly-csv-cell:hover img {
    transform: scale(1.15);
}
#captureArea {
    position: absolute;
    left: -99999px;
    top: 0;
    padding: 40px;
    background: #121212;
}
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #777;
    font-style: italic;
    background: #1a1a1a;
    border-radius: 16px;
}
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c2c2c;
    color: #fff;
    padding: 12px 24px;
    border-left: 5px solid #4caf50;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    font-size: 0.9rem;
    z-index: 9999;
}
.loading-overlay {
    text-align: center;
    padding: 40px 20px;
    color: #4caf50;
    background: #1a1a1a;
    border-radius: 16px;
    margin-bottom: 20px;
}
.builder-topbar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.builder-topbar .title {
    font-size: 1rem;
    color: #aaa;
    margin-left: auto;
}
.builder-hint {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    margin-top: 12px;
    font-style: italic;
}
#imagePopup {
    position: fixed;
    pointer-events: none;
    border: 2px solid #4caf50;
    border-radius: 8px;
    background: #222;
    padding: 4px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 10000;
    max-width: 300px;
    max-height: 450px;
}
#imagePopup img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}
.csv-title {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 16px;
}
.csv-description {
    max-width: 800px;
    margin: 0 auto 16px auto;
    padding: 10px 14px;
    background-color: #1e1e1e;
    border-left: 4px solid #4caf50;
    color: #ccc;
    font-size: 13px;
    border-radius: 6px;
    line-height: 1.5;
}
.csv-description a {
    color: #4caf50;
    text-decoration: none;
}
.csv-hint {
    color: #bbb;
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}
.csv-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: #1a1a1a;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
}
.csv-controls label {
    color: #ccc;
    font-size: 0.85rem;
}
.csv-controls select {
    background: #2c2c2c;
    border: 1px solid #3d3d3d;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}
.csv-grid {
    display: grid;
    grid-template-columns: 1fr repeat(12, 1fr);
    gap: 6px;
    margin-bottom: 4px;
    width: 100%;
}
@media (max-width: 1300px) {
    .csv-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
.csv-year-label {
    grid-column: span 1;
    background-color: #333;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.85rem;
}
.csv-cell {
    background-color: #1e1e1e;
    color: #fff;
    border: none;
    font-size: clamp(9px, 1.8vw, 13px);
    padding: 6px 4px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}
.csv-cell img {
    transition: transform 0.2s ease;
}
@media (max-width: 480px) {
    .csv-cell img {
        width: 32px;
        height: 44px;
    }
}
.csv-cell span {
    font-size: 0.75rem;
    line-height: 1.2;
}
.csv-cell.green {
    background-color: #4caf50;
}
.csv-cell.orange {
    background-color: #ff9800;
}
.csv-cell.red {
    background-color: #f44336;
}
.csv-cell.white {
    background-color: #f5f5f5;
    color: #000;
}
/* Small action buttons that appear on hover in filled cells */
.builder-cell-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 5;
}
.builder-cell:hover .builder-cell-actions {
    opacity: 1;
}
.builder-cell-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.builder-cell-action-btn:hover {
    background: #4caf50;
}
.builder-cell-action-btn.clear-btn:hover {
    background: #f44336;
}
.hidden {
    display: none !important;
}
/* Image picker modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 20px;
}
.modal-backdrop.visible {
    display: flex;
}
.modal {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}
.modal-close {
    background: transparent;
    border: 1px solid #3a3a3a;
    color: #aaa;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.15s;
    flex-shrink: 0;
}
.modal-close:hover {
    background: #2c2c2c;
    color: #fff;
}

.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    background: #181818;
    padding: 4px;
    border-radius: 10px;
}
.modal-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s;
}
.modal-tab:hover {
    color: #fff;
}
.modal-tab.active {
    background: #4caf50;
    color: #fff;
}

.modal-panel {
    display: none;
}
.modal-panel.active {
    display: block;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
.image-choice {
    background: #202020;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 6px;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}
.image-choice:hover {
    border-color: #4caf50;
    background: #252525;
}
.image-choice img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.image-panel-loading {
    text-align: center;
    padding: 40px 20px;
    color: #4caf50;
    font-style: italic;
}
.image-panel-empty {
    text-align: center;
    padding: 40px 20px;
    color: #777;
    font-style: italic;
}

.url-input-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.url-input-row input[type="text"] {
    background: #2c2c2c;
    border: 1px solid #3d3d3d;
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}
.url-input-row input[type="text"]:focus {
    border-color: #4caf50;
}
.url-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #151515;
    border: 1px dashed #2e2e2e;
    border-radius: 10px;
    padding: 12px;
    color: #666;
    font-style: italic;
    font-size: 0.85rem;
}
.url-preview img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    object-fit: contain;
}
.catalog-toggle {
    display: inline-flex;
    gap: 4px;
    background: #181818;
    padding: 4px;
    border: 1px solid #2a2a2a;
}
.catalog-toggle-btn {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}
.catalog-toggle-btn:hover {
    color: #fff;
}
.catalog-toggle-btn.active {
    background: #4caf50;
    color: #fff;
}
.display-toggle {
    display: inline-flex;
    gap: 4px;
    background: #181818;
    padding: 4px;
    border: 1px solid #2a2a2a;
}
.display-toggle-btn {
    background: transparent;
    border: none;
    color: #aaa;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}
.display-toggle-btn:hover {
    color: #fff;
}
.display-toggle-btn.active {
    background: #4caf50;
    color: #fff;
}
.type-filter-checkboxes {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 4px 8px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
}
.type-filter-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #ddd;
    cursor: pointer;
    user-select: none;
}

.type-filter-checkboxes input[type="checkbox"] {
    accent-color: #4caf50;
    cursor: pointer;
    margin: 0;
}
.type-filter-wrap {
    position: relative;
    display: inline-block;
    margin: 8px 0;
}

.type-filter-toggle {
    background: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.type-filter-toggle .caret {
    font-size: 0.7rem;
    opacity: 0.7;
}

.type-filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 500;
    background: #1c1c1c;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 6px;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.type-filter-dropdown.hidden {
    display: none;
}

.type-filter-actions {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}

.type-filter-actions button {
    flex: 1;
    background: #2a2a2a;
    color: #ddd;
    border: 1px solid #444;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 0.75rem;
    cursor: pointer;
}

.type-filter-actions button:hover {
    background: #333;
}

.type-filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.type-filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #ddd;
}
.type-filter-checkboxes label:hover {
    background: #2a2a2a;
}
.builder-cell.dragging {
    opacity: 0.45;
}
.builder-cell.drag-over {
    outline: 3px dashed #4caf50;
    outline-offset: -3px;
}
body.builder-dragging {
    user-select: none;
}
.template-cell {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.template-cell-input {
    width: 100%;
    box-sizing: border-box;

    border: none;
    background: transparent;

    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;

    color: inherit;
    outline: none;
}

.template-cell-input::placeholder {
    color: #777;
    font-style: italic;
}