:root {
    --green: #5b9f35;
    --green-dark: #327024;
    --green-soft: #eaf5df;
    --yellow: #f5b81b;
    --ink: #1b2b18;
    --muted: #7f8878;
    --line: #edf0e8;
    --paper: #fffdf7;
    --panel: #ffffff;
    --shadow: 0 18px 50px rgba(53, 89, 35, .14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 6% 8%, rgba(255, 244, 189, .62), transparent 28%),
        linear-gradient(145deg, #eef8e9 0%, #fffaf0 48%, #edf7e8 100%);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

.shell {
    position: relative;
    width: min(100%, 430px);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--paper);
    box-shadow: 0 0 60px rgba(62, 89, 48, .16);
}

.page {
    display: none;
    min-height: 100vh;
    padding: 20px 20px 96px;
    animation: rise .25s ease both;
}

.page.is-active {
    display: block;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.topbar {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
}

.page-title,
.sub-header,
.card-head,
.detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-hero {
    position: relative;
    margin: -4px -4px 0;
    padding: 0;
    overflow: hidden;
    border-radius: 34px 34px 0 0;
}

.hero-bg {
    width: 100%;
    height: 220px;
    display: block;
    border-radius: 34px 34px 0 0;
    object-fit: cover;
}

.search-card {
    margin: 12px 0 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 12px 24px rgba(54, 90, 33, .12);
}

.location,
.icon-btn,
.back-btn,
.sub-header > button:first-child {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255,255,255,.76);
    box-shadow: 0 8px 18px rgba(44, 71, 29, .1);
}

.location {
    width: auto;
    padding: 0 12px;
    border-radius: 20px;
    font-weight: 700;
}

.search-card input {
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0 12px;
    color: var(--ink);
    background: transparent;
}

.search-card button,
.primary-btn,
.detail-actions button:nth-child(2),
.checkin-card button {
    min-height: 42px;
    border-radius: 22px;
    padding: 0 18px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.quick-grid button,
.message-kinds button,
.tool-grid button {
    display: grid;
    gap: 7px;
    justify-items: center;
    min-width: 0;
    color: #4f5c47;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
}

.quick-grid span,
.message-kinds span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 18px;
    color: var(--green-dark);
    background: linear-gradient(145deg, #f0f9e8, #e6f2df);
    box-shadow: 
        inset 0 0 0 1px rgba(91, 159, 53, .14),
        0 4px 12px rgba(91, 159, 53, .08);
    font-size: 20px;
    transition: all 0.25s ease;
}

.message-kinds button:active span,
.message-kinds button:hover span {
    transform: translateY(-2px);
    box-shadow: 
        inset 0 0 0 1px rgba(91, 159, 53, .2),
        0 8px 20px rgba(91, 159, 53, .15);
}

.message-kinds .msg-icon {
    position: relative;
}

.message-kinds .msg-chat {
    background: linear-gradient(145deg, #ffe8e8, #ffd6d6);
    color: #d64545;
}

.message-kinds .msg-bell {
    background: linear-gradient(145deg, #fff5e6, #ffe4b3);
    color: #e87d3c;
}

.message-kinds .msg-progress {
    background: linear-gradient(145deg, #e6f3ff, #cce7ff);
    color: #3d8bd9;
}

.message-kinds .msg-event {
    background: linear-gradient(145deg, #f5e6ff, #e6c8ff);
    color: #9b59b6;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 12px;
}

.section-head h2,
.form-card h2,
.notice-card h2,
.profile-panel h2 {
    margin: 0;
    font-size: 18px;
}

.section-head button,
.map-mode {
    color: var(--muted);
    background: transparent;
}

.pet-mini,
.pet-card,
.rescue-strip,
.form-card,
.station-card,
.message-card,
.notice-card,
.profile-panel,
.checkin-card,
.apply-pet {
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(234, 240, 224, .9);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(65, 87, 50, .08);
}

.pet-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pet-mini {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #edf1e9;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(49, 77, 35, .08);
}

.pet-mini .pet-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.pet-mini img {
    width: 100%;
    aspect-ratio: 1.05;
    object-fit: cover;
}

.pet-mini .status-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 4px 8px;
    border-radius: 0 10px 0 0;
    color: #fff;
    background: rgba(91, 159, 53, .9);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
}

.pet-mini .pet-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 72px;
    padding: 12px 12px 14px;
    background: #fff;
    justify-content: space-between;
}

.pet-mini strong {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0;
}

.pet-mini .pet-vaccine {
    font-size: 12px;
    color: #6c6f6a;
}

.pet-mini .pet-meta {
    display: flex;
    align-items: center;
    gap: 0;
    color: #6c6f6a;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

.pet-mini .pet-meta span {
    display: inline;
}

.pet-mini .pet-meta span:not(:last-child)::after {
    content: '|';
    color: #cfd3ca;
    margin: 0 6px;
    font-size: 12px;
}

.pet-mini .pet-district {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #858983;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

.pet-mini .pet-district::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    background: #8b9289;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 22s7-6.1 7-13a7 7 0 1 0-14 0c0 6.9 7 13 7 13Zm0-9.5A3.5 3.5 0 1 0 12 5a3.5 3.5 0 0 0 0 7.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.volunteer-card,
.process-hero {
    min-height: 132px;
    margin: 22px 0;
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(90deg, rgba(255, 248, 213, .92), rgba(255, 251, 234, .7));
    box-shadow: var(--shadow);
}

.volunteer-card h2,
.process-hero h2 {
    margin: 0 0 6px;
    color: #7b4b18;
}

.volunteer-card p {
    margin: 0 0 12px;
    color: #a3732b;
}

.volunteer-card button {
    min-height: 34px;
    padding: 0 16px;
    border-radius: 17px;
    color: #fff;
    background: var(--green);
}

.rescue-strip,
.apply-pet {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
}

.rescue-strip img,
.apply-pet img,
.station-card img {
    width: 72px;
    height: 72px;
    border-radius: 15px;
    object-fit: cover;
}

.rescue-strip p,
.apply-pet p,
.station-card p,
.message-card p,
.pet-card p,
.muted {
    margin: 4px 0;
    color: var(--muted);
    font-size: 13px;
}

.rescue-strip button {
    min-height: 34px;
    border-radius: 17px;
    padding: 0 12px;
    color: var(--green-dark);
    background: var(--green-soft);
    white-space: nowrap;
}

.page-title,
.sub-header {
    min-height: 52px;
    margin-bottom: 14px;
}

.page-title h1,
.sub-header h1 {
    margin: 0;
    font-size: 22px;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-tabs button {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 0 18px;
    border-radius: 18px;
    color: #475241;
    background: #f3f5ef;
}

.filter-tabs .is-selected {
    color: #fff;
    background: var(--green);
}

.list-stack,
.station-list,
.message-list {
    display: grid;
    gap: 14px;
}

.pet-card {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 14px;
    padding: 12px;
}

.pet-card img {
    width: 112px;
    height: 112px;
    border-radius: 18px;
    object-fit: cover;
}

.pet-card strong {
    font-size: 17px;
}

.heart {
    width: 34px;
    height: 34px;
    color: #42503b;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.heart.is-on {
    color: #fff;
    background: #ff6b6b;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.tag {
    padding: 5px 10px;
    border-radius: 14px;
    color: var(--green-dark);
    background: var(--green-soft);
    font-size: 12px;
    font-weight: 700;
}

.page-detail {
    padding: 0 0 100px;
    background: #fff;
}

.back-btn {
    position: fixed;
    top: 24px;
    left: 20px;
    z-index: 1000;
    font-size: 30px;
    line-height: 1;
}

.detail-photo-viewer {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f3f5ef;
    touch-action: pan-y;
}

.detail-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-photo-gallery {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    grid-auto-flow: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 33.333%;
    overflow-x: auto;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(12, 20, 10, 0), rgba(12, 20, 10, .68));
    scroll-snap-type: x mandatory;
}

.detail-photo-gallery[hidden] {
    display: none;
}

.detail-photo-gallery button {
    width: clamp(46px, 13vw, 64px);
    flex: 0 0 auto;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid rgba(255,255,255,.42);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,.28);
    opacity: .72;
    scroll-snap-align: start;
}

.detail-photo-gallery button.is-active {
    border-color: #fff;
    opacity: 1;
    transform: translateY(-3px);
}

.detail-photo-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-panel {
    position: relative;
    margin-top: -28px;
    padding: 24px 22px 0;
    border-radius: 28px 28px 0 0;
    background: #fff;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-panel h1 {
    margin: 0;
    font-size: 28px;
}

.detail-panel .status-tag {
    padding: 4px 10px;
    border-radius: 10px;
    color: #fff;
    background: rgba(91, 159, 53, .9);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.detail-panel h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 16px;
    color: var(--green-dark);
}

.detail-panel h2 span {
    color: var(--green);
}

.detail-panel p {
    line-height: 1.7;
}

.detail-section {
    padding: 18px;
    margin-bottom: 12px;
    background: rgba(255,255,255,.85);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(65, 87, 50, .06);
}

.detail-section:first-of-type {
    margin-top: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 0;
}

.info-grid div {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 8px;
}

.info-grid dt {
    color: #55614d;
    font-weight: 700;
    font-size: 13px;
}

.info-grid dd {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
}

.publisher-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--green-soft);
    border-radius: 14px;
}

.publisher-avatar {
    display: flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
    font-size: 24px;
}

.publisher-info {
    flex: 1;
}

.publisher-info strong {
    font-size: 16px;
    color: var(--ink);
}

.publisher-info p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.requirement-list {
    display: grid;
    gap: 10px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8faf4;
    border-radius: 12px;
}

.req-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
    background: var(--green-soft);
    font-size: 14px;
}

.desc-text {
    margin: 12px 0 0;
    padding: 14px;
    background: #f8faf4;
    border-radius: 12px;
    color: #4a5445;
    font-size: 14px;
    line-height: 1.7;
}

.detail-panel hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

.detail-panel dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.detail-panel dl div {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
}

.detail-panel dt {
    color: #55614d;
    font-weight: 800;
}

.detail-panel dd {
    margin: 0;
    color: var(--muted);
}

.detail-actions {
    position: sticky;
    bottom: 78px;
    display: grid;
    grid-template-columns: 64px 1fr 1fr;
    gap: 10px;
    align-items: center;
    margin: 24px -2px 0;
    padding: 12px 0;
    background: #fff;
}

.detail-actions button {
    min-height: 46px;
    border-radius: 23px;
    color: var(--ink);
    background: #f5f7f0;
    font-weight: 800;
}

.detail-actions button:last-child {
    color: #744300;
    background: #ffc928;
}

.form-card {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.form-card label {
    display: grid;
    gap: 8px;
    color: #4e5947;
    font-weight: 800;
}

.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-bottom: 1px solid var(--line);
    outline: 0;
    color: var(--ink);
    background: transparent;
}

.form-card textarea {
    min-height: 76px;
    resize: vertical;
}

.check-line {
    grid-template-columns: auto 1fr;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.check-line input {
    width: auto;
    min-height: auto;
}

.form-note {
    min-height: 22px;
    margin: 0;
    color: var(--green-dark);
    font-weight: 800;
}

.timeline {
    display: grid;
    gap: 14px;
    padding: 0;
    margin: 18px 0 0;
    list-style: none;
}

.timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(70, 90, 54, .08);
}

.timeline span {
    grid-row: span 2;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    color: var(--green-dark);
    background: var(--green-soft);
    font-weight: 900;
}

.timeline strong {
    align-self: end;
}

.timeline p {
    margin: 0;
    color: var(--muted);
}

.station-card {
    display: grid;
    grid-template-columns: 82px 1fr 44px;
    gap: 12px;
    align-items: center;
    padding: 12px;
}

.station-card a {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    background: var(--green);
}

.message-kinds {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 10px 0 26px;
}

.swipe-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.swipe-delete {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e74c3c;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.swipe-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    box-shadow: none;
    background: rgba(255,255,255,.9);
    transition: transform 0.25s ease;
}

.message-card {
    position: relative;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    box-shadow: none;
}

.avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: var(--green);
}

.message-card time {
    color: var(--muted);
    font-size: 12px;
    background: transparent;
    padding: 0;
}

.message-card em {
    position: absolute;
    right: 13px;
    bottom: 12px;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #ff5a4d;
    font-size: 11px;
    font-style: normal;
}

.publish-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.publish-card {
    padding: 0;
    border-radius: 22px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.publish-card img {
    width: 100%;
    height: auto;
    border-radius: 22px;
}

.notice-card {
    margin-top: 22px;
    padding: 20px;
}

.notice-card p {
    margin: 12px 0;
    color: var(--muted);
}

.profile-hero {
    min-height: 176px;
    margin: -20px -20px 18px;
    padding: 24px 20px;
    border-radius: 0 0 28px 28px;
    background: linear-gradient(135deg, rgba(232, 246, 215, .95), rgba(255, 246, 196, .72));
}

.profile-hero .icon-btn {
    margin-left: auto;
}

.profile-info {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 14px;
    align-items: center;
    margin-top: 20px;
}

.profile-info img,
.profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: var(--green-soft);
}

.profile-info strong {
    margin-right: 8px;
    font-size: 19px;
}

.profile-info span {
    padding: 4px 9px;
    border-radius: 12px;
    color: var(--green-dark);
    background: #d9efca;
    font-size: 12px;
}

.profile-info p {
    margin: 8px 0 0;
    color: #54723f;
}

.profile-panel {
    padding: 20px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 8px;
    margin-top: 18px;
}

.tool-grid button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 70px;
    padding-top: 40px;
}

.tool-grid button::before {
    content: attr(data-icon);
    position: absolute;
    top: 0;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 14px;
    color: var(--green-dark);
    background: #f2f6ee;
    font-size: 18px;
}

.checkin-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    background: linear-gradient(135deg, #fff5ce, #fff);
}

.checkin-card h2 {
    margin: 0;
    color: #b8582a;
}

.checkin-card p {
    margin: 6px 0 0;
    color: #9f7a3a;
}

.bottom-nav {
    position: fixed;
    right: 50%;
    bottom: 14px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: min(calc(100% - 28px), 420px);
    min-height: 80px;
    padding: 8px 12px;
    transform: translateX(50%);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(52, 78, 37, .12),
        0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(234, 240, 224, 0.6);
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 56px;
    min-height: 60px;
    padding: 6px 8px;
    border: none;
    border-radius: 16px;
    color: #7f8878;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bottom-nav .nav-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 159, 53, 0.2);
}

.bottom-nav .nav-item:hover {
    background: rgba(91, 159, 53, 0.05);
    transform: translateY(-2px);
}

.bottom-nav .nav-item:active {
    transform: translateY(0);
}

.bottom-nav .nav-item.is-active {
    color: var(--green-dark);
    background: var(--green-soft);
}

.bottom-nav .nav-item.is-active::before {
    content: '';
    position: absolute;
    top: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--green);
}

.bottom-nav .nav-icon {
    width: 28px;
    height: 28px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-item.is-active .nav-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(91, 159, 53, 0.3));
}

.bottom-nav .home-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f8878'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

.bottom-nav .is-active .home-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235b9f35'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
}

.bottom-nav .discover-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f8878'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

.bottom-nav .is-active .discover-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235b9f35'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
}

.bottom-nav .nav-add {
    position: relative;
    min-width: 72px;
    min-height: 72px;
    margin: -20px 0;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    box-shadow: 
        0 10px 28px rgba(91, 159, 53, 0.35),
        0 4px 12px rgba(91, 159, 53, 0.25),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-add:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 14px 36px rgba(91, 159, 53, 0.4),
        0 6px 16px rgba(91, 159, 53, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.bottom-nav .nav-add:active {
    transform: translateY(-2px) scale(1.02);
}

.bottom-nav .nav-add .nav-icon {
    width: 36px;
    height: 36px;
}

.bottom-nav .add-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/%3E%3C/svg%3E");
}

.bottom-nav .nav-add .nav-label {
    display: none;
}

.bottom-nav .messages-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f8878'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.bottom-nav .is-active .messages-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235b9f35'%3E%3Cpath d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.bottom-nav .profile-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f8878'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

.bottom-nav .is-active .profile-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235b9f35'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

.bottom-nav .nav-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.bottom-nav .nav-item.is-active .nav-label {
    font-weight: 800;
}

@media (min-width: 860px) {
    .bottom-nav {
        bottom: 24px;
        width: min(calc(100% - 56px), 440px);
        min-height: 84px;
        padding: 10px 16px;
        border-radius: 44px;
        box-shadow: 
            0 12px 40px rgba(52, 78, 37, .15),
            0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    .bottom-nav .nav-item {
        min-width: 64px;
        min-height: 64px;
        padding: 8px 10px;
        border-radius: 20px;
    }
    
    .bottom-nav .nav-icon {
        width: 32px;
        height: 32px;
    }
    
    .bottom-nav .nav-add {
        min-width: 80px;
        min-height: 80px;
        margin: -24px 0;
    }
    
    .bottom-nav .nav-add .nav-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 380px) {
    .bottom-nav {
        width: calc(100% - 16px);
        min-height: 72px;
        padding: 6px 8px;
        border-radius: 36px;
    }
    
    .bottom-nav .nav-item {
        min-width: 48px;
        min-height: 52px;
        padding: 4px 6px;
        border-radius: 12px;
    }
    
    .bottom-nav .nav-icon {
        width: 24px;
        height: 24px;
    }
    
    .bottom-nav .nav-add {
        min-width: 64px;
        min-height: 64px;
        margin: -16px 0;
    }
    
    .bottom-nav .nav-add .nav-icon {
        width: 32px;
        height: 32px;
    }
    
    .bottom-nav .nav-label {
        font-size: 10px;
    }
}

.is-hidden {
    display: none !important;
}

#home [data-district] {
    display: none;
}

.publish-header {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 140px;
    padding: 24px 20px;
    margin: -20px -20px 18px;
    border-radius: 0 0 28px 28px;
    background: linear-gradient(135deg, rgba(232, 246, 215, .95), rgba(255, 246, 196, .72));
}

.publish-header button:first-child {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255,255,255,.85);
    font-size: 28px;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(44, 71, 29, .1);
}

.publish-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--ink);
}

.publish-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.rescue-form {
    display: grid;
    gap: 0;
}

.form-section {
    margin-bottom: 8px;
    padding: 18px;
    background: rgba(255,255,255,.85);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(65, 87, 50, .06);
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--green-dark);
}

.form-section h2 span {
    color: var(--green);
}

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #4e5947;
    font-weight: 800;
    font-size: 14px;
}

.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 20px;
    color: #5a6655;
    background: #f3f5ef;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
}

.radio-btn.is-active {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
}

.radio-btn span {
    font-size: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.select-row {
    position: relative;
    display: flex;
    align-items: center;
}

.select-row select,
.select-row input {
    width: 100%;
    min-height: 44px;
    padding: 0 32px 0 14px;
    border: 0;
    border-radius: 12px;
    color: var(--ink);
    background: #f3f5ef;
    appearance: none;
}

.select-arrow {
    position: absolute;
    right: 12px;
    color: var(--muted);
    font-size: 18px;
    pointer-events: none;
}

.input-row {
    position: relative;
}

.input-row input {
    width: 100%;
    min-height: 44px;
    padding: 0 80px 0 14px;
    border: 0;
    border-radius: 12px;
    color: var(--ink);
    background: #f3f5ef;
}

.char-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    color: var(--muted);
    font-size: 12px;
}

.form-group input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    color: var(--ink);
    background: #f3f5ef;
}

.form-group textarea {
    width: 100%;
    min-height: 88px;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    color: var(--ink);
    background: #f3f5ef;
    resize: none;
}

.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid,
.select-row input.is-invalid,
.select-row select.is-invalid,
.input-row input.is-invalid {
    outline: 2px solid #ff806f;
    background: #fff6f4;
}

.location-btn {
    position: absolute;
    right: 6px;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    color: var(--green-dark);
    background: var(--green-soft);
    font-size: 13px;
    font-weight: 700;
}

.optional {
    float: right;
    color: var(--muted);
    font-size: 12px;
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    margin-top: 12px;
    border-radius: 12px;
    background: var(--green-soft);
}

.privacy-note span {
    display: flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: var(--green);
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.privacy-note p {
    margin: 0;
    color: var(--green-dark);
    font-size: 12px;
    line-height: 1.5;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.photo-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    border: 2px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    background: #fafbf7;
    font-size: 28px;
}

.photo-add span {
    color: var(--green);
}

.photo-add small {
    font-size: 12px;
    line-height: 1.4;
}

.photo-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 84px;
    border: 2px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
    background: #fafbf7;
    font-size: 24px;
}

.photo-slot[hidden] {
    display: none;
}

.photo-preview {
    min-height: 84px;
    border-radius: 16px;
    overflow: hidden;
    background: #f3f5ef;
}

.photo-preview:empty {
    display: none;
}

.photo-preview:not(:empty) {
    display: contents;
}

.photo-preview img {
    width: 100%;
    min-height: 84px;
    aspect-ratio: 1;
    border-radius: 16px;
    object-fit: cover;
    display: block;
}

.photo-item {
    position: relative;
    min-height: 84px;
    border-radius: 16px;
    overflow: hidden;
    background: #f3f5ef;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.photo-item.is-dragging {
    opacity: .58;
    outline: 2px solid var(--green);
}

.photo-item img {
    height: 100%;
}

.photo-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(22, 32, 18, .72);
    font-size: 18px;
    line-height: 1;
}

.photo-handle {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #fff;
    background: rgba(22, 32, 18, .62);
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

.submit-btn {
    min-height: 50px;
    margin-top: 8px;
    border-radius: 25px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.submit-btn:disabled {
    cursor: wait;
    opacity: .72;
}

.form-feedback {
    margin: 12px 0 0;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--green-dark);
    background: var(--green-soft);
    font-size: 13px;
    line-height: 1.5;
}

.form-feedback[data-type="error"] {
    color: #9b372f;
    background: #fff0ed;
}

.form-feedback[data-type="success"] {
    color: #2f6b3f;
    background: #edf8e8;
}

.submit-note {
    text-align: center;
    margin: 12px 0 24px;
    color: var(--muted);
    font-size: 12px;
}

.tag-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag-btn {
    min-height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    color: #5a6655;
    background: #f3f5ef;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid transparent;
}

.tag-btn.is-active {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
}

@media (min-width: 860px) {
    body {
        padding: 28px;
    }

    .shell {
        border-radius: 34px;
        min-height: 900px;
    }
}

@media (max-width: 380px) {
    .page {
        padding-inline: 14px;
    }

    .quick-grid,
    .message-kinds {
        gap: 6px;
    }

    .pet-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.city-selector {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.city-selector .selector-header {
    padding: 18px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}

.city-selector .selector-list {
    display: flex;
    flex-wrap: wrap;
    padding: 12px;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.city-selector .city-item {
    min-height: 44px;
    padding: 0 20px;
    border-radius: 22px;
    color: #5a6655;
    background: #f3f5ef;
    font-size: 14px;
    font-weight: 600;
    border: 0;
}

.city-selector .city-item:active {
    color: #fff;
    background: var(--green);
}

.selector-list::-webkit-scrollbar {
    display: none;
}

.city-selector > div:first-child:not(.selector-header) {
    width: 100%;
    max-width: 400px;
    border-radius: 24px 24px 0 0;
    background: #fff;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.rescue-list {
    display: grid;
    gap: 14px;
}

.rescue-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(234, 240, 224, .9);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(65, 87, 50, .08);
}

.rescue-image-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.rescue-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rescue-status {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}

.rescue-status.status-pending {
    color: #fff;
    background: #e87d3c;
}

.rescue-status.status-rescued {
    color: #fff;
    background: var(--green);
}

.rescue-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.rescue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rescue-header strong {
    font-size: 15px;
    font-weight: 800;
}

.rescue-header span {
    color: var(--muted);
    font-size: 12px;
}

.rescue-place {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.rescue-desc {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rescue-meta {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.rescue-meta span {
    padding: 3px 8px;
    border-radius: 8px;
    color: #5a6655;
    background: #f3f5ef;
    font-size: 11px;
    font-weight: 600;
}

.rescue-list-page {
    display: grid;
    gap: 16px;
}

.rescue-card-large {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 14px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(234, 240, 224, .9);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(65, 87, 50, .08);
}

.rescue-card-large .rescue-image-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 16px;
}

.rescue-card-large .rescue-header strong {
    font-size: 17px;
}

.rescue-card-large .rescue-desc {
    -webkit-line-clamp: 3;
    font-size: 13px;
}

.rescue-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding: 10px;
    background: #f8faf4;
    border-radius: 10px;
    font-size: 13px;
    color: var(--ink);
}

.contact-btn {
    margin-top: 10px;
    min-height: 42px;
    border-radius: 21px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.badge-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
}

.badge-status.status-pending {
    color: #fff;
    background: #e87d3c;
}

.badge-status.status-rescued {
    color: #fff;
    background: var(--green);
}

.page-process {
    padding: 0;
    background: #fff;
}

.page-process .process-image {
    width: 100%;
    height: auto;
    display: block;
}

.page-process .back-btn {
    top: 16px;
}

.page-login,
.page-register {
    padding-top: 80px;
    background: linear-gradient(180deg, rgba(232, 246, 215, .8), #fffaf0 30%);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    display: inline-flex;
    width: 80px;
    height: 80px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    font-size: 36px;
    box-shadow: 0 12px 30px rgba(91, 159, 53, .3);
}

.login-header h1 {
    margin: 24px 0 8px;
    font-size: 28px;
    color: var(--ink);
}

.login-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.login-form,
.register-form {
    padding: 0 20px;
}

.login-form .form-group,
.register-form .form-group {
    margin-bottom: 16px;
}

.login-form label,
.register-form label {
    display: block;
    margin-bottom: 8px;
    color: #4e5947;
    font-weight: 800;
    font-size: 14px;
}

.login-form input,
.register-form input {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(65, 87, 50, .08);
}

.login-btn,
.register-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    border-radius: 26px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    box-shadow: 0 10px 24px rgba(91, 159, 53, .25);
}

.login-note,
.register-note {
    min-height: 24px;
    margin: 12px 0;
    text-align: center;
    font-size: 13px;
    color: #e87d3c;
}

.login-links {
    text-align: center;
    margin-top: 24px;
}

.login-links button {
    color: var(--green-dark);
    background: transparent;
    font-size: 14px;
    font-weight: 600;
}

.register-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.register-header button:first-child {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255,255,255,.85);
    font-size: 28px;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(44, 71, 29, .1);
}

.register-header h1 {
    margin: 0;
    font-size: 22px;
}

.logout-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    padding: 10px 18px;
    border-radius: 20px;
    color: #e87d3c;
    background: rgba(232, 125, 60, .1);
    font-size: 13px;
    font-weight: 700;
}

.publish-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: 12px;
    background: #f3f5ef;
}

.publish-tabs button {
    flex: 1;
    min-height: 40px;
    border-radius: 10px;
    color: #5a6655;
    background: transparent;
    font-weight: 600;
    transition: all 0.2s ease;
}

.publish-tabs .is-selected {
    color: #fff;
    background: var(--green);
}

.my-publish-list {
    display: grid;
    gap: 14px;
}

.publish-item {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 12px;
    padding: 14px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(234, 240, 224, .9);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(65, 87, 50, .06);
}

.publish-item img {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
}

.publish-item strong {
    font-size: 16px;
    font-weight: 800;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.item-status {
    padding: 3px 10px;
    border-radius: 10px;
    color: #e87d3c;
    background: rgba(232, 125, 60, .1);
    font-size: 11px;
    font-weight: 700;
}

.item-status.status-success {
    color: var(--green-dark);
    background: var(--green-soft);
}

.item-status.status-rescued {
    color: #fff;
    background: var(--green);
}

.item-desc {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 8px 0;
}

.item-meta {
    display: flex;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-start;
}

.item-actions button {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.item-actions [data-edit] {
    color: var(--green-dark);
    background: var(--green-soft);
}

.item-actions [data-delete] {
    color: #e87d3c;
    background: rgba(232, 125, 60, .1);
}

.add-btn {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    color: #fff;
    background: var(--green);
    font-size: 14px;
    font-weight: 700;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
    background: #f3f5ef;
    font-size: 32px;
    margin-bottom: 16px;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 15px;
}

.empty-state button {
    min-height: 44px;
    padding: 0 24px;
    border-radius: 22px;
    color: #fff;
    background: var(--green);
    font-weight: 700;
}

.page-conversation {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0;
    background: #e5e5e5;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: #eee;
    border-bottom: 1px solid #ddd;
}

.chat-back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-back-btn:hover {
    background: #ddd;
}

.chat-contact {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b9f35, #327024);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.contact-info {
    flex: 1;
}

.contact-info h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #000;
}

.contact-status {
    font-size: 12px;
    color: #666;
}

.chat-menu {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-menu:hover {
    background: #ddd;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #e5e5e5;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-date-divider {
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    color: #999;
}

.chat-date-divider::before,
.chat-date-divider::after {
    content: '';
    display: inline-block;
    width: 30%;
    height: 1px;
    background: #ccc;
    vertical-align: middle;
    margin: 0 8px;
}

.chat-message-wrapper {
    display: flex;
}

.chat-message-wrapper.sent {
    justify-content: flex-end;
}

.chat-message-wrapper.received {
    justify-content: flex-start;
}

.chat-message {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
}

.chat-message.sent {
    background: #5b9f35;
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}

.chat-message.received {
    background: #fff;
    color: #333;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

.chat-message p {
    margin: 0;
    word-break: break-all;
}

.message-time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    opacity: 0.6;
    text-align: right;
}

.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-chat p {
    margin: 0;
    font-size: 15px;
}

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: #f0f0f0;
    border-top: 1px solid #ddd;
    gap: 8px;
}

.input-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-btn:hover {
    background: #ddd;
}

.chat-input {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 22px;
    padding: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

.chat-input input {
    flex: 1;
    height: 36px;
    padding: 0 16px;
    border: none;
    font-size: 15px;
    background: transparent;
    outline: none;
}

.chat-input .send-btn {
    width: 56px;
    height: 32px;
    margin-right: 4px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.chat-input .send-btn:not(:disabled) {
    color: #fff;
    background: #5b9f35;
}

.chat-input .send-btn:disabled {
    color: #ccc;
    background: #e5e5e5;
}

.page-admin {
    padding: 0;
    background: #f5f7f0;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
}

.admin-title h1 {
    margin: 0;
    font-size: 20px;
}

.admin-title p {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.8;
}

.admin-logout {
    padding: 8px 16px;
    border-radius: 16px;
    color: var(--green-dark);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
}

.admin-nav {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.admin-nav .nav-item {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    color: #5a6655;
    background: #f3f5ef;
    font-size: 13px;
    font-weight: 600;
}

.admin-nav .nav-item.is-active {
    color: #fff;
    background: var(--green);
}

.admin-content {
    padding: 16px;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(65, 87, 50, .06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--green-soft);
    font-size: 24px;
}

.stat-info strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}

.stat-info span {
    font-size: 12px;
    color: var(--muted);
}

.recent-section {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(65, 87, 50, .06);
}

.recent-section h2 {
    margin: 0 0 12px;
    font-size: 16px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #f8faf4;
}

.item-type {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 16px;
}

.item-type.pet {
    background: #eaf5df;
}

.item-type.rescue {
    background: #fff5e6;
}

.item-name {
    flex: 1;
    font-weight: 700;
    font-size: 14px;
}

.item-status {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: var(--green-soft);
    color: var(--green-dark);
}

.item-time {
    font-size: 12px;
    color: var(--muted);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.panel-header h2 {
    margin: 0;
    font-size: 16px;
}

.search-bar {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.search-bar input {
    min-width: 180px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: 0;
    background: #fff;
    font-size: 13px;
}

.search-bar button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 14px;
}

.data-table {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(65, 87, 50, .06);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    background: #f8faf4;
    font-weight: 800;
    color: #55614d;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.status-badge.available {
    background: var(--green-soft);
    color: var(--green-dark);
}

.status-badge.adopted {
    background: #d9efca;
    color: #2f6b3f;
}

.status-badge.pending {
    background: #fff5e6;
    color: #e87d3c;
}

.status-badge.rescued {
    background: var(--green-soft);
    color: var(--green-dark);
}

.role-badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.role-badge.admin {
    background: #f5e6ff;
    color: #9b59b6;
}

.role-badge.normal {
    background: var(--green-soft);
    color: var(--green-dark);
}

.role-badge.volunteer {
    background: #e6f3ff;
    color: #3d8bd9;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 0;
    font-size: 14px;
}

.action-btn.edit {
    background: #eaf5df;
}

.action-btn.delete {
    background: #fff0ed;
}

.action-btn.delete:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(65, 87, 50, .06);
}

.msg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.msg-sender {
    font-weight: 700;
    font-size: 14px;
}

.msg-time {
    font-size: 12px;
    color: var(--muted);
}

.msg-content {
    margin: 0;
    font-size: 14px;
    color: var(--ink);
    line-height: 1.5;
}

.msg-delete {
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 12px;
    background: #fff0ed;
    color: #e87d3c;
    font-size: 12px;
    font-weight: 600;
}

.admin-back-btn {
    position: fixed;
    top: 24px;
    left: 20px;
    z-index: 1000;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255,255,255,.9);
    box-shadow: 0 8px 18px rgba(44, 71, 29, .1);
    font-size: 24px;
    line-height: 1;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    width: 90%;
    max-width: 380px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(232, 246, 215, .95), rgba(255, 246, 196, .72));
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--ink);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,.1);
    color: #666;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

#adminEditForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#adminEditForm .form-group {
    margin-bottom: 0;
}

#adminEditForm label {
    display: block;
    margin-bottom: 8px;
    color: #4e5947;
    font-weight: 800;
    font-size: 14px;
}

#adminEditForm input,
#adminEditForm select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    color: var(--ink);
    background: #f3f5ef;
    font-size: 15px;
}

#adminEditForm select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8878' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-cancel,
.btn-submit {
    flex: 1;
    min-height: 44px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 700;
}

.btn-cancel {
    color: var(--muted);
    background: #f3f5ef;
}

.btn-submit {
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
}
