/* SEO H1 — clip-hidden on all screen sizes, present in DOM for crawlers */
.seo-h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --primary-color: #1a2332;
    --primary-light: #2d3a4d;
    --accent-color: #00a8e8;
    --accent-hover: #0096d1;
    --danger-color: #c53030;
    --success-color: #10b981;
    --text-dark: #1a202c;
    --text-medium: #4a5568;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Paper / floor theme */
    --paper-bg: #FEFCE8;
    --paper-border: #E5E0D0;
    --bin-bg: #D3DEE9;
    --bin-border: #9FB3C8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background:
        linear-gradient(to bottom, rgba(226, 232, 240, 0.5) 0%, rgba(245, 240, 232, 0.5) 100%),
        #eef1f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

/* ============================
   Header — TSK Standard
   ============================ */
.header {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.header-logo-link:hover { opacity: 0.85; }

.logo-image {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.tool-name-btn {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a2332;
    white-space: nowrap;
    line-height: 1.2;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
}
.tool-name-btn:hover { color: #00a8e8; }

.header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
    font-family: inherit;
}
.header-icon-btn:hover {
    border-color: #00a8e8;
    background: #f7fafc;
    color: #00a8e8;
}
.header-icon-btn svg { width: 20px; height: 20px; }

.lang-short {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: 0.02em;
}
.header-icon-btn:hover .lang-short { color: #00a8e8; }

.language-selector { position: relative; }
.language-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    z-index: 1001;
    overflow: hidden;
}
.language-dropdown.active {
    display: block;
    animation: langSlideDown 0.2s ease;
}
@keyframes langSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    color: #1a202c;
    transition: background 0.15s;
    font-family: inherit;
}
.lang-option:hover { background: #f7fafc; }
.lang-option.active { background: rgba(0, 168, 232, 0.08); color: #00a8e8; }
.lang-check { font-size: 0.75rem; opacity: 0; transition: opacity 0.15s; }
.lang-option.active .lang-check { opacity: 1; }

/* ============================
   Actions Menu (kebab)
   ============================ */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 32, 44, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1100;
    justify-content: center;
    align-items: flex-start;
    padding: 76px 20px 20px;
}
.menu-overlay.active { display: flex; }
.menu-content {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px;
    animation: sheetIn 0.2s ease;
}
.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.menu-header h3 { font-size: 1.05rem; color: var(--primary-color); font-weight: 600; margin: 0; }
.menu-header-right { display: flex; align-items: center; gap: 8px; }
.close-menu {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
}
.close-menu:hover { background: var(--bg-light); color: var(--text-dark); }

.menu-action {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.15s;
}
.menu-action:last-child { margin-bottom: 0; }
.menu-action:hover { border-color: var(--accent-color); background: var(--bg-light); }
.menu-action.danger { color: var(--danger-color); border-color: #f0c2c2; }
.menu-action.danger:hover { background: #fef2f2; border-color: var(--danger-color); }
.menu-action .action-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.action-content { display: flex; flex-direction: column; gap: 2px; }
.action-hint { font-size: 0.75rem; color: var(--text-light); font-weight: 400; font-style: italic; }
.menu-divider { height: 1px; background: var(--border-color); margin: 12px 2px; }

/* ============================
   Layout
   ============================ */
.main-content {
    flex: 1;
    width: 100%;
}
.content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 7rem;
}

/* Info Banner */
.info-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    border: 1.5px solid #4fc3f7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(79, 195, 247, 0.1);
    overflow: hidden;
}
.info-icon { font-size: 1.3rem; flex-shrink: 0; }
.info-text { flex: 1; color: #01579b; font-size: 0.9rem; line-height: 1.5; }
.info-text strong { color: #004d7a; font-weight: 600; }
.info-close {
    background: none;
    border: none;
    color: #01579b;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    margin-left: auto;
}
.info-close:hover { background: rgba(1, 87, 155, 0.1); color: #004d7a; }

/* ============================
   Toolbar (search + actions)
   ============================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.search-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 11px 14px 11px 38px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.15s;
}
.search-wrap-sm .search-input { padding-left: 14px; }
.search-input:focus { outline: none; border-color: var(--accent-color); }

.toolbar-actions { display: flex; gap: 6px; }
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-medium);
    font-size: 1.1rem;
    transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--accent-color); color: var(--accent-color); background: var(--bg-light); }
#cloud-save-btn.cloud-dirty { border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(0,168,232,0.18); }

/* Tag filter chips */
.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.filter-chip {
    padding: 5px 12px;
    border: 1.5px solid var(--border-color);
    background: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.filter-chip:hover { border-color: var(--accent-color); }
.filter-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ============================
   Canvas — the floor
   ============================ */
.canvas { position: relative; }

/* Bins grid */
.bins-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 16px; /* extra row gap so the next row's peek papers clear the row above */
    margin-bottom: 6px;
}

.bin {
    position: relative;
    background: transparent;
    min-height: 104px;
    padding: 40px 22px 14px;
    cursor: pointer;
    transition: transform 0.1s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
/* Bucket body — trapezoid tapering inward toward the bottom */
.bin::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #DCE6EF, var(--bin-bg));
    clip-path: polygon(6% 0, 94% 0, 86% 100%, 14% 100%);
    box-shadow: inset 0 -8px 14px rgba(0,0,0,0.05);
    z-index: 0;
    transition: filter 0.15s;
}
/* Bucket rim — elliptical lip sitting on top of the body */
.bin::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 4%;
    right: 4%;
    height: 18px;
    background: var(--bin-bg);
    border: 2px solid var(--bin-border);
    border-radius: 50%;
    z-index: 1;
}
.bin:hover::before { filter: brightness(0.98); }
.bin:active { transform: translateY(1px); }

/* Peeking papers fanned out of the bucket rim */
.bin-peeks {
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 46px;
    z-index: 2;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.bin-peek {
    position: absolute;
    top: 0;
    width: 52%;
    max-width: 170px;
    background: var(--paper-bg);
    border: 1px solid var(--paper-border);
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
    padding: 6px 10px;
    font-size: 0.72rem;
    color: var(--text-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(var(--peek-x, 0)) rotate(var(--peek-rot, 0deg));
    transform-origin: bottom center;
}
.bin-peek-empty { color: var(--text-light); font-style: italic; }

.bin-header {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    padding: 0 6%;
}
.bin-name {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.bin-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Loose divider */
.loose-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    color: var(--text-light);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.loose-divider::before,
.loose-divider::after {
    content: '';
    flex: 1;
    border-top: 1px dashed var(--bin-border);
}

/* Litter — scattered ungrouped cards */
.litter-section {
    column-count: 2;
    column-gap: 0;
}
/* Stable per-note paper palette (soft, desaturated pastels).
   Each class just overrides the --paper-bg / --paper-border custom props,
   so litter cards, bin peeks and the edit textarea all pick it up. */
.note-c0 { --paper-bg: #FEFCE8; --paper-border: #E5E0D0; } /* cream */
.note-c1 { --paper-bg: #FEF3C7; --paper-border: #EADCA6; } /* pale yellow */
.note-c2 { --paper-bg: #FCE7F0; --paper-border: #ECC9D8; } /* blush pink */
.note-c3 { --paper-bg: #E6F6EC; --paper-border: #C7E6D2; } /* mint */
.note-c4 { --paper-bg: #E4F1FB; --paper-border: #C5DDEE; } /* sky blue */
.note-c5 { --paper-bg: #FDEBDD; --paper-border: #EFD2BC; } /* peach */
.note-c6 { --paper-bg: #EEEBFA; --paper-border: #D5CEEC; } /* lavender */

.litter-card {
    position: relative;
    display: inline-block;
    width: calc(100% - 14px);
    margin: 0 7px;
    background: var(--paper-bg);
    border: 1px solid var(--paper-border);
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);
    padding: 12px 14px;
    cursor: pointer;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    transform: rotate(var(--rot, 0deg)) translateX(var(--offx, 0));
    transition: transform 0.12s ease, box-shadow 0.15s ease;
    /* Let a touch that starts on a card still scroll the canvas vertically,
       but block the long-press text-selection/callout that otherwise cancels
       the drag gesture on mobile. */
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.litter-card:hover {
    transform: rotate(0deg) translateX(0) translateY(-2px);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

/* Drag-to-group: source card left behind while dragging */
.litter-card.litter-dragging {
    opacity: 0.35;
    transform: rotate(var(--rot, 0deg)) translateX(var(--offx, 0));
    transition: opacity 0.12s ease;
    touch-action: none; /* once lifted, no scroll interferes with the drag */
}
/* Floating clone that follows the pointer */
.litter-ghost {
    position: fixed;
    left: 0;
    top: 0;
    margin: 0;
    z-index: 1200;
    pointer-events: none;
    opacity: 0.95;
    transform: rotate(-2deg) scale(1.04);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    cursor: grabbing;
}
/* Bin highlighted as the drop target */
.bin.bin-drop-hover {
    transform: scale(1.04);
    transition: transform 0.1s ease;
}
.bin.bin-drop-hover::before { filter: brightness(0.93); }
.bin.bin-drop-hover::after {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 35, 50, 0.2);
}
.bin.bin-drop-hover .bin-name { color: var(--primary-color); }
.litter-text {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dark);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.litter-tag-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-color);
}

/* Flat results / group entry rows */
.results-section, .group-entry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.result-row {
    background: var(--paper-bg);
    border: 1px solid var(--paper-border);
    border-radius: 6px;
    padding: 12px 14px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.result-row:hover { box-shadow: var(--shadow); border-color: var(--accent-color); }
.result-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.row-tag {
    font-size: 0.7rem;
    background: rgba(0,168,232,0.1);
    color: var(--accent-hover);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
}
.row-group { font-size: 0.7rem; color: var(--text-light); }

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.7; }
.empty-state p { font-size: 0.95rem; }

/* ============================
   Dump FAB
   ============================ */
.dump-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    align-self: stretch;         /* match the search input's height */
    padding: 0 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.dump-btn:hover { background: var(--primary-light); box-shadow: var(--shadow-lg); }
.dump-btn:active { transform: scale(0.99); }
.dump-btn-icon { width: 24px; height: 24px; flex-shrink: 0; }

/* ============================
   Buttons
   ============================ */
.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    font-family: inherit;
}
.btn-primary { background: var(--primary-color); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }
.btn-outline { background: var(--bg-white); color: var(--primary-color); border: 1.5px solid var(--primary-color); }
.btn-outline:hover { background: var(--primary-color); color: #fff; }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-danger:hover { background: #a52727; }
.btn-danger-text {
    background: none;
    color: var(--danger-color);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.85rem;
    padding: 10px 4px;
}
.btn-danger-text:hover { text-decoration: underline; }

/* ============================
   Sheets / modals
   ============================ */
.sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 32, 44, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.sheet-overlay.active { display: flex; }

/* Edit sheet opens on top of the group sheet (which also sits at 1100) */
#edit-sheet-overlay { z-index: 1150; }
/* Confirm (e.g. delete entry) must sit above the edit sheet and context menu */
#confirm-overlay { z-index: 1250; }

.sheet {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sheetIn 0.2s ease;
}
@keyframes sheetIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}
.sheet-header h3 { font-size: 1.05rem; color: var(--primary-color); font-weight: 600; }
.sheet-header-actions { display: flex; align-items: center; gap: 6px; }
.sheet-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
}
.sheet-close:hover { background: var(--bg-light); color: var(--text-dark); }

.sheet-subhead { padding: 12px 18px 0; }
.sheet-body { padding: 14px 18px; overflow-y: auto; }

.sheet-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 18px;
    border-top: 1px solid var(--border-color);
}
.sheet-footer-right { display: flex; gap: 10px; }

.edit-textarea {
    width: 100%;
    background: var(--paper-bg, #fff);
    border: 1.5px solid var(--paper-border, var(--border-color));
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-dark);
    resize: vertical;
    min-height: 84px;
}
.edit-textarea:focus { outline: none; border-color: var(--accent-color); }

.field { margin-top: 12px; }
.field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-medium);
    margin-bottom: 5px;
}
.text-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text-dark);
    background: #fff;
}
.text-input:focus { outline: none; border-color: var(--accent-color); }
select.text-input { cursor: pointer; }

.field-error { color: var(--danger-color); font-size: 0.8rem; margin-top: 6px; }

/* Tag chips inside edit sheet */
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag-chips:empty { margin-bottom: 0; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,168,232,0.1);
    color: var(--accent-hover);
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
}
.tag-chip-x {
    background: none;
    border: none;
    color: var(--accent-hover);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}
.tag-chip-x:hover { color: var(--danger-color); }

/* Confirm / small dialogs */
.confirm-sheet {
    max-width: 380px;
    text-align: center;
    padding: 24px;
}
.confirm-sheet h3 { font-size: 1.05rem; color: var(--primary-color); margin-bottom: 10px; }
.confirm-sheet p { color: var(--text-medium); font-size: 0.92rem; margin-bottom: 18px; }
.confirm-icon { font-size: 2.4rem; margin-bottom: 12px; }
.confirm-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confirm-sheet .text-input { margin-bottom: 14px; text-align: left; }
.paste-hint { font-size: 0.85rem; }
.paste-textarea { resize: vertical; min-height: 96px; font-family: inherit; }

/* Group context menu */
.context-menu {
    display: none;
    position: fixed;
    z-index: 1200;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 160px;
    overflow: hidden;
    padding: 4px;
}
.context-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    background: none;
    border: none;
    font-size: 0.88rem;
    color: var(--text-dark);
    cursor: pointer;
    font-family: inherit;
    border-radius: 5px;
}
.context-item:hover { background: var(--bg-light); }
.context-item.danger { color: var(--danger-color); }

/* ============================
   Footer
   ============================ */
.app-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    margin-top: auto;
}
.app-footer p { margin: 0; color: var(--text-medium); font-size: 0.9rem; }
.app-footer p + p { margin-top: 8px; }
.footer-separator { margin: 0 8px; color: var(--text-light); }
.footer-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}
.footer-link:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }
.version-badge {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-light);
    font-family: monospace;
    letter-spacing: 0.02em;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}
.version-badge:hover { opacity: 1; color: var(--accent-color); }

/* ============================
   Toast
   ============================ */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary-color);
    color: #fff;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1300;
    max-width: 90vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger-color); }
.toast.success { background: var(--success-color); }

/* ============================
   Responsive
   ============================ */
@media (max-width: 768px) {
    .header-inner { padding: 0.4rem 1rem; }
    .logo-image { height: 34px; width: auto; }
    .header-icons { gap: 6px; }
    .header-icon-btn { width: 36px; height: 36px; }
    .header-icon-btn svg { width: 18px; height: 18px; }
    .lang-short { font-size: 0.8rem; }
    .content-container { padding: 1rem 1rem 7rem; }
}

@media (max-width: 600px) {
    .bins-section { grid-template-columns: 1fr; }
    .litter-section { column-count: 1; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0.35rem 0.75rem; }
    .logo-image { height: 30px; width: auto; }
    .tool-name-btn { font-size: 1.25rem; }
    .content-container { padding: 0.85rem 0.75rem 6.5rem; }
    .dump-btn { padding: 0 15px; gap: 6px; font-size: 0.9rem; }
    .sheet-footer { flex-wrap: wrap; }
}
