:root {
    color-scheme: light;
    --bg: #f3f6f7;
    --surface: #ffffff;
    --surface-2: #eef3f4;
    --line: #e2e9eb;
    --text: #152226;
    --muted: #708087;
    --accent: #12a99d;
    --accent-2: #ffd66b;
    --danger: #dc4656;
    --success: #16885d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 0 0, rgba(18, 169, 157, .11), transparent 30rem),
        radial-gradient(circle at 100% 12%, rgba(255, 214, 107, .13), transparent 24rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }

.shell {
    width: min(100%, 500px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 76px 16px 104px;
}

.shell.auth {
    display: grid;
    align-content: center;
    padding-top: 28px;
    padding-bottom: 28px;
}

.topbar {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 50%;
    width: min(100%, 500px);
    height: 62px;
    padding: 0 16px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #25c5b8, #0b8f87);
    box-shadow: 0 8px 22px rgba(18, 169, 157, .2);
}
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.icon-link {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(28, 58, 64, .06);
    text-decoration: none;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(25px, 7vw, 34px); letter-spacing: -.04em; line-height: 1.12; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.lead { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.page-head { margin-bottom: 20px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 26px 2px 12px; }
.section-head span { color: var(--muted); font-size: 12px; }

.card {
    padding: 18px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(38, 65, 70, .07);
}
.card + .card { margin-top: 14px; }

.auth-card { padding: 24px 20px; }
.auth-logo {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #25c5b8, #0b8f87);
    font-size: 26px;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(18, 169, 157, .2);
}

.field { margin-top: 16px; }
.field label { display: block; margin: 0 0 7px; color: #34464c; font-size: 13px; font-weight: 700; }
.input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    color: var(--text);
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: 0;
    transition: border-color .18s, box-shadow .18s;
}
.input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(18, 169, 157, .1); }
.hint { margin: 7px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.button {
    display: inline-flex;
    min-height: 48px;
    padding: 0 17px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: linear-gradient(135deg, #1fbbb0, #0d988f);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(18, 169, 157, .2);
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}
.button.block { width: 100%; margin-top: 20px; }
.button.secondary { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.button.danger { color: var(--danger); background: #fff1f3; border: 1px solid #f7cbd1; box-shadow: none; }

.alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
}
.alert.error { color: #a82938; background: #fff0f2; border: 1px solid #f6c9cf; }
.alert.success { color: #106b49; background: #eafaf2; border: 1px solid #c6ecda; }

.listing {
    display: grid;
    grid-template-columns: 88px 1fr;
    min-height: 112px;
    padding: 0;
    overflow: hidden;
    text-decoration: none;
}
.listing img { width: 88px; height: 100%; min-height: 112px; object-fit: cover; background: var(--surface-2); }
.listing-body { display: flex; min-width: 0; padding: 15px; flex-direction: column; justify-content: center; }
.listing-title { overflow: hidden; font-size: 17px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.listing-meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.status { display: inline-flex; width: max-content; margin-top: 10px; padding: 4px 8px; color: var(--success); background: #e7f8f0; border-radius: 99px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status.off { color: #9a6710; background: #fff6dd; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.quick {
    padding: 14px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(38, 65, 70, .045);
}
.quick strong { display: block; margin-bottom: 4px; font-size: 21px; }
.quick span { color: var(--muted); font-size: 11px; }

.listing-summary {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 15px;
    align-items: center;
}
.listing-summary > img,
.summary-placeholder {
    width: 82px;
    height: 98px;
    object-fit: cover;
    border-radius: 16px;
    background: var(--surface-2);
}
.summary-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 28px; }
.listing-summary > div { min-width: 0; }
.listing-summary strong { display: block; margin-top: 9px; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.listing-summary small { display: block; margin-top: 4px; color: var(--muted); }

.manage-list {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 14px 40px rgba(38, 65, 70, .06);
}
.manage-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto 18px;
    gap: 12px;
    min-height: 82px;
    padding: 14px;
    align-items: center;
    text-decoration: none;
    transition: background-color .16s, transform .16s;
}
.manage-row + .manage-row { border-top: 1px solid var(--line); }
.manage-row:active { background: #f1f8f8; transform: scale(.995); }
.manage-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: #087f78;
    background: #e7f8f6;
    border-radius: 14px;
    font-size: 20px;
    font-weight: 800;
}
.manage-copy { min-width: 0; }
.manage-copy strong { display: block; font-size: 15px; }
.manage-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.instant-badge {
    padding: 5px 7px;
    color: #087c58;
    background: #e6f8ef;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
}
.chevron { color: #a2adb1; font-size: 25px; line-height: 1; }
.publish-note { margin: 14px 8px 0; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }

.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.photo {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.primary-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    padding: 4px 7px;
    color: #5f4300;
    background: var(--accent-2);
    border-radius: 99px;
    font-size: 9px;
    font-weight: 900;
}
.sort-actions {
    position: absolute;
    z-index: 2;
    top: 7px;
    right: 7px;
    display: flex;
    gap: 5px;
}
.sort-actions form { margin: 0; }
.sort-actions button {
    display: grid;
    width: 31px;
    height: 31px;
    padding: 0;
    place-items: center;
    color: #fff;
    background: rgba(11, 24, 27, .78);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-size: 15px;
}
.photo-actions {
    position: absolute;
    right: 5px;
    bottom: 5px;
    left: 5px;
    display: flex;
    gap: 5px;
}
.photo-actions form { flex: 1; }
.photo-actions button {
    width: 100%;
    min-height: 31px;
    padding: 0 5px;
    color: #fff;
    background: rgba(5, 8, 10, .82);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 9px;
    backdrop-filter: blur(8px);
    font-size: 10px;
    cursor: pointer;
}

.upload-box {
    position: relative;
    display: grid;
    min-height: 120px;
    margin-top: 14px;
    padding: 18px;
    place-items: center;
    text-align: center;
    border: 1px dashed rgba(18, 169, 157, .48);
    border-radius: 17px;
    background: #f0fbfa;
}
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box strong { display: block; font-size: 14px; }
.upload-box span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.bottom-nav {
    position: fixed;
    z-index: 20;
    bottom: 0;
    left: 50%;
    width: min(100%, 500px);
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(255, 255, 255, .92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
.nav-link {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.nav-link.active { color: var(--text); background: var(--surface); }

.empty { padding: 36px 20px; color: var(--muted); text-align: center; }
.footer-note { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

@media (min-width: 501px) {
    .shell { border-right: 1px solid var(--line); border-left: 1px solid var(--line); }
}

