:root {
    --bg: #f3f4f6;
    --panel: #ffffff;
    --ink: #161a22;
    --muted: #687080;
    --line: #dfe3ea;
    --accent: #14532d;
    --accent-soft: #e7f3ec;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(20, 83, 45, 0.08), transparent 34rem),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 304px 1fr;
    min-height: 100vh;
}

.sidebar {
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    padding: 28px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 30px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #14532d 0 50%, transparent 50%),
        linear-gradient(135deg, #ffffff, #d9f0e2);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.brand h1 {
    font-size: 1.2rem;
    line-height: 1.1;
    margin: 0;
}

.brand p,
.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.search-box {
    margin-bottom: 24px;
}

.side-section {
    display: grid;
    gap: 8px;
    margin-bottom: 26px;
}

.side-title {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0 0 2px;
    text-transform: uppercase;
}

.side-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.92rem;
}

.side-pill:hover,
.side-pill.active {
    background: var(--accent-soft);
    color: #0f3f23;
}

.side-pill span {
    color: var(--muted);
}

.new-group-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    margin-top: 8px;
}

.group-logo {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
}

.group-logo.neutral {
    background: #e5e7eb;
    color: #111827;
}

.task-pill {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}

.task-pill.active,
.task-pill:hover {
    border-color: #14532d;
    background: var(--accent-soft);
}

.task-pill strong {
    min-width: 28px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #14532d;
    color: #fff;
    text-align: center;
    font-size: 0.78rem;
}

.task-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 900;
}

.library {
    padding: 32px;
    position: relative;
    transition: background 160ms ease, box-shadow 160ms ease;
}

.library.dz-drag-hover {
    background: #e7f3ec;
    box-shadow: inset 0 0 0 2px #14532d;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.toolbar h2 {
    margin: 0;
    font-size: 2rem;
}

.quick-upload {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto auto;
    gap: 8px;
    align-items: center;
}

.upload-destination {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    padding: 7px 11px;
    white-space: nowrap;
}

.drop-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px dashed #aeb8c7;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--muted);
}

.drop-hint strong {
    color: var(--ink);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.photo-tile {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #e8edf3;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    cursor: zoom-in;
}

.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.photo-tile:hover img {
    transform: scale(1.035);
}

.photo-title {
    position: absolute;
    inset: auto 8px 8px 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.56);
    color: #fff;
    font-size: 0.78rem;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-group {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 5px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.84);
    color: #202020;
    font-size: 0.72rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-group.todo {
    background: #fff7ed;
    color: #9a3412;
}

.empty-state {
    min-height: 56vh;
    border: 1px dashed #c7c6bf;
    border-radius: 8px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    padding: 40px 20px;
}

.empty-state h3 {
    margin-bottom: 8px;
}

.empty-state p {
    max-width: 520px;
    color: var(--muted);
}

.dropzone {
    border: 1.5px dashed #b8b7b0;
    border-radius: 8px;
    background: #fafaf8;
    min-height: 180px;
}

.dz-preview {
    display: none;
}

.photo-modal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    overflow: hidden;
}

.photo-preview {
    min-height: 70vh;
    background:
        linear-gradient(45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #d1d5db 75%),
        linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
    background-color: #f8fafc;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
    display: grid;
    place-items: center;
}

.photo-preview img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
}

.photo-meta {
    padding: 22px;
    background: var(--panel);
}

.photo-facts {
    margin: 22px 0;
    display: grid;
    gap: 12px;
}

.photo-facts div {
    display: grid;
    gap: 2px;
}

.photo-facts dt {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

.photo-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.download-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.action-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.share-body {
    min-height: 100vh;
    background: #f3f4f6;
}

.share-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.share-card {
    width: min(980px, 100%);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.share-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.share-image {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #f8fafc;
}

.share-details {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 20px;
}

.share-details h1 {
    margin: 0;
    font-size: 1.5rem;
}

@media (max-width: 800px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .library {
        padding: 20px 14px;
    }

    .toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-upload {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .drop-hint {
        align-items: flex-start;
        flex-direction: column;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-modal {
        grid-template-columns: 1fr;
    }

    .share-details {
        align-items: flex-start;
        flex-direction: column;
    }

    .photo-preview {
        min-height: 44vh;
    }
}
