:root {
[hidden] { display: none !important; }
    --raised: #f4efec; --page: #ffffff; --ink: #251f21; --ink2: #585254;
    --hairline: #eae9ea; --teal: #73a89a; --red: #ed313e;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    background: var(--raised); color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px; line-height: 24px; -webkit-text-size-adjust: 100%;
}
.card {
    background: var(--page); max-width: 1040px; margin: 0 auto;
    padding: 24px 24px 36px; min-height: 100vh;
    display: flex; flex-direction: column; gap: 24px;
}
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.025em; }
.sub { margin: 0; color: var(--ink2); }
h2 { font-size: 21px; margin: 0 0 12px; letter-spacing: -0.025em; }
.group { display: flex; flex-direction: column; gap: 12px; }
.quiet { color: var(--ink2); margin: 4px 0 0; }

.btn {
    font: inherit; font-weight: 600; border: 0; border-radius: 4px; cursor: pointer;
    padding: 10px 16px; min-height: 44px; text-align: center;
}
.btn.compact { min-height: 44px; padding: 8px 12px; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:disabled { background: #c0bebf; cursor: default; }
.btn.secondary { background: var(--raised); color: var(--ink); }
.btn.ghost { background: none; color: var(--ink2); }
.danger-text { color: var(--red); }

.field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.field span { font-size: 12px; line-height: 20px; color: var(--ink2); }
.field input {
    font: inherit; color: var(--ink); padding: 10px 12px; min-height: 44px;
    border: 1px solid var(--hairline); border-radius: 4px; background: var(--page);
}
.add-row { display: flex; flex-direction: column; gap: 12px; }

.project-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 0; min-height: 44px; background: none; border: 0;
    border-top: 1px solid var(--hairline); text-align: left; cursor: pointer;
    color: var(--ink); font: inherit;
}
.project-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.project-name { font-weight: 600; }
.project-count { color: var(--ink2); font-size: 12px; line-height: 20px; }
.chev { color: var(--ink2); font-size: 20px; line-height: 1; }

.thumb {
    width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
    background: var(--raised); position: relative;
}
.thumb.small { width: 44px; height: 44px; aspect-ratio: auto; border-radius: 8px; flex: none; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
    position: absolute; left: 4px; bottom: 4px; padding: 1px 6px;
    background: rgba(37,31,33,0.75); color: #fff; border-radius: 4px;
    font-size: 10px; line-height: 16px; font-weight: 600;
}

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cell {
    display: flex; flex-direction: column; gap: 6px; background: none; border: 0;
    padding: 0; cursor: pointer; text-align: left; font: inherit; min-height: 44px;
}
.cell-meta { display: flex; flex-direction: column; }
.cell-apt { font-size: 12px; line-height: 20px; font-weight: 600; }
.cell-date { font-size: 12px; line-height: 20px; color: var(--ink2); }

.pending-name { margin: 0; font-weight: 600; }
#pending-box { display: flex; flex-direction: column; gap: 12px; }

.callout { border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.callout.note { background: var(--raised); color: var(--ink2); }
.callout.danger { background: #fdecec; color: var(--red); }
.closing { color: var(--ink2); font-size: 12px; line-height: 20px; }

.overlay {
    position: fixed; inset: 0; z-index: 40; background: rgba(37,31,33,0.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
}
.overlay-close {
    position: absolute; top: 12px; right: 12px; z-index: 41;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,0.15); color: #fff; font-size: 24px; cursor: pointer;
}
.overlay-body { display: flex; flex-direction: column; gap: 12px; max-width: 640px; width: 100%; max-height: 100%; }
.full { max-width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #000; align-self: center; }
.overlay-meta { margin: 0; color: #fff; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; }
.overlay-meta span { color: rgba(255,255,255,0.75); }
.overlay-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.overlay-edit { display: flex; flex-direction: column; gap: 12px; background: var(--page); padding: 12px; border-radius: 12px; }

@media (min-width: 768px) {
    .card { padding: 36px; }
    h1 { font-size: 36px; }
    .add-row { flex-direction: row; align-items: flex-end; }
    .grid { grid-template-columns: repeat(3, 1fr); }
    .thumb.small { width: 56px; height: 56px; }
}
