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

:root {
    --primary: #7BA05B;
    --primary-dark: #5A7A3A;
    --primary-light: #9BC07B;
    --accent: #F9E79F;
    --bg: #f5f5f5;
    --bg-white: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --message-sent: #7BA05B;
    --message-received: #ffffff;
    --danger: #dc3545;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-white);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    background: var(--bg-white);
}

.screen.active {
    display: flex;
}

/* Login Screen */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.875rem;
}

.login-form {
    width: 100%;
    max-width: 320px;
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-tab:not(.active):hover {
    background: rgba(123, 160, 91, 0.1);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.login-info {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.code-inputs {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.code-digit {
    width: 42px !important;
    height: 50px;
    text-align: center;
    font-size: 1.25rem !important;
    font-weight: 600;
    padding: 0 !important;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.code-digit:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(123, 160, 91, 0.2);
}

.code-digit.filled {
    border-color: var(--primary);
    background-color: rgba(123, 160, 91, 0.1);
}

.code-digit.error {
    border-color: var(--danger);
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 0.875rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.login-footer {
    margin-top: 1.5rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
}

/* Header */
.app-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    padding-top: calc(1rem + var(--safe-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-title-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.25rem;
}

.caseworker-badge {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
    display: none;
}

.caseworker-badge:not(:empty) {
    display: block;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Search Bar */
.search-bar {
    padding: 0.75rem 1rem;
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-bar i {
    color: var(--text-muted);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.search-bar input:focus {
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.conversation-item:hover {
    background: var(--bg);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.avatar.large {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.avatar.unread {
    background: var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.conversation-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.conversation-preview {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview.unread {
    color: var(--text-primary);
    font-weight: 500;
}

.unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Screen */
.chat-header {
    background: var(--primary);
    color: white;
    padding: 0.75rem;
    padding-top: calc(0.75rem + var(--safe-top));
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-contact-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.chat-contact-info .avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    font-size: 1rem;
}

.contact-details h2 {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-details .status {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-right: 0.5rem;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
}

.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.scroll-to-bottom {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 100;
}

.scroll-to-bottom.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-bottom:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.scroll-to-bottom:active {
    transform: scale(0.95);
}

.date-divider {
    text-align: center;
    padding: 0.5rem 0;
}

.date-divider span {
    background: rgba(0,0,0,0.1);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
}

.message {
    max-width: 80%;
    padding: 0.625rem 0.875rem;
    border-radius: 16px;
    position: relative;
}

.message.sent {
    align-self: flex-end;
    background: var(--message-sent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--message-received);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-text {
    font-size: 0.9375rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.message-time {
    font-size: 0.6875rem;
    opacity: 0.7;
}

.message-status {
    font-size: 0.75rem;
}

.message.sent .message-status {
    color: rgba(255,255,255,0.8);
}

/* Message Input */
.message-input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + var(--safe-bottom));
    background: var(--bg-white);
    border-top: 1px solid var(--border);
}

.message-input-container .icon-btn {
    color: var(--text-muted);
    flex-shrink: 0;
}

.message-input-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--bg);
    border-radius: 24px;
    font-size: 0.9375rem;
}

.message-input-container input:focus {
    outline: none;
}

.send-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.2s;
}

.send-btn:hover {
    background: var(--primary-dark);
}

/* Contacts List */
.contacts-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.contact-item:hover {
    background: var(--bg);
}

.contact-item .avatar {
    width: 44px;
    height: 44px;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 500;
    font-size: 0.9375rem;
}

.contact-phone {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Settings */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: var(--safe-bottom);
}

.settings-section {
    padding: 1rem;
    border-bottom: 8px solid var(--bg);
}

.settings-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.settings-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-user .user-info h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.settings-user .user-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0;
}

.settings-item i {
    width: 24px;
    text-align: center;
    color: var(--primary);
    font-size: 1rem;
}

.settings-item-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-item-content span:first-child {
    font-size: 0.9375rem;
}

.settings-value {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-danger {
    width: 100%;
    padding: 0.875rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9375rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* Clickable Settings Item */
.settings-item.clickable {
    cursor: pointer;
    transition: background 0.2s;
    margin: 0 -1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.settings-item.clickable:hover {
    background: var(--bg);
}

.settings-item.clickable > i:last-child {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Profile Screen */
.profile-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.profile-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.profile-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-section h3 i {
    font-size: 1.125rem;
}

.profile-section .form-group {
    margin-bottom: 1rem;
}

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

.profile-section .form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.profile-section .form-group input,
.profile-section .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    background: var(--bg);
    transition: border-color 0.2s;
}

.profile-section .form-group input:focus,
.profile-section .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.profile-actions {
    margin-top: 1.5rem;
    padding-bottom: 5rem;
}

.profile-actions .btn-primary {
    padding: 1rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
    z-index: 100;
}

.bottom-nav.visible {
    display: flex;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.6875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    transform: scale(0.95);
}

/* Screens with bottom nav need padding */
.screen.with-nav {
    padding-bottom: 70px;
}

/* Resources Screen */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.resource-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--bg);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.resource-card:active {
    transform: scale(0.98);
}

.resource-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.resource-icon.wellness { background: linear-gradient(135deg, #e91e63, #f06292); }
.resource-icon.skills { background: linear-gradient(135deg, #3f51b5, #7986cb); }
.resource-icon.events { background: linear-gradient(135deg, #ff9800, #ffb74d); }
.resource-icon.tools { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

.resource-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.resource-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.quick-help-section {
    padding: 1.5rem 1rem;
    margin: 0 1rem 1rem;
    background: #fff5f5;
    border-radius: 16px;
    border: 1px solid #ffe0e0;
}

.quick-help-section h3 {
    font-size: 1rem;
    color: var(--danger);
    margin-bottom: 1rem;
    text-align: center;
}

.emergency-btn {
    width: 100%;
    padding: 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.emergency-btn:active {
    opacity: 0.9;
}

.crisis-links {
    display: flex;
    gap: 0.75rem;
}

.crisis-link {
    flex: 1;
    padding: 0.75rem;
    background: white;
    border: 1px solid #ffe0e0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.8125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    text-align: center;
}

.crisis-link i {
    color: var(--danger);
    font-size: 1.125rem;
}

/* Wellness Screen */
.wellness-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 2rem;
}

.mood-tracker-section {
    margin-bottom: 2rem;
}

.mood-tracker-section h3,
.wellness-resources h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.mood-options {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.mood-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.25rem;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mood-btn.selected {
    border-color: var(--primary);
    background: rgba(123, 160, 91, 0.1);
}

.mood-emoji {
    font-size: 1.5rem;
}

.mood-btn span:last-child {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.resource-item > i:first-child {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.resource-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.resource-name {
    font-weight: 500;
    font-size: 0.9375rem;
}

.resource-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.resource-item > i:last-child {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Life Skills Screen */
.lifeskills-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--bg);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.skill-card:active {
    transform: scale(0.98);
}

.skill-card i {
    font-size: 2rem;
    color: var(--primary);
}

.skill-card span {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Events Screen */
.events-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.location-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(123, 160, 91, 0.1);
    border-bottom: 1px solid var(--border);
}

.location-banner i {
    color: var(--primary);
}

.location-banner span {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
}

.events-list {
    flex: 1;
    padding: 1rem;
}

.no-events {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.no-events i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.no-events .hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Tools Screen */
.tools-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--bg);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-card:active {
    transform: scale(0.98);
}

.tool-card i {
    font-size: 2rem;
    color: var(--primary);
}

.tool-card span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.tool-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--primary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

/* Home Screen */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.greeting-section h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.greeting-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.home-header .icon-btn {
    color: white;
}

.home-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 80px;
}

.main-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.main-action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.main-action-btn:active {
    transform: scale(0.98);
}

.main-action-btn .action-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.main-action-btn.worker .action-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.main-action-btn.crisis .action-icon {
    background: linear-gradient(135deg, #e91e63, #c2185b);
}

.action-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.action-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.main-action-btn > i:last-child {
    color: var(--text-muted);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.resource-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.resource-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.resource-tile:active {
    transform: scale(0.98);
}

.resource-tile i {
    font-size: 1.5rem;
    color: var(--primary);
}

.resource-tile span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Crisis Screen */
.crisis-header {
    background: linear-gradient(135deg, #e91e63, #c2185b) !important;
}

.crisis-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 2rem;
}

.crisis-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.crisis-warning i {
    color: #f57c00;
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.crisis-warning p {
    font-size: 0.9375rem;
    color: #e65100;
    line-height: 1.4;
}

.help-service {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.help-service.featured {
    border: 2px solid var(--primary);
}

.service-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.service-header > i {
    width: 40px;
    height: 40px;
    background: var(--bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary);
}

.service-header.kids-help > i {
    background: #e8f5e9;
    color: #4caf50;
}

.service-header.one-stop > i {
    background: #e3f2fd;
    color: #2196f3;
}

.service-header.ontario-211 > i {
    background: #fff3e0;
    color: #ff9800;
}

.service-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.service-header p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.service-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.service-btn.call {
    background: #e8f5e9;
    color: #2e7d32;
}

.service-btn.text {
    background: #e3f2fd;
    color: #1565c0;
}

.service-btn.web {
    background: var(--bg);
    color: var(--text-primary);
}

.service-btn:active {
    transform: scale(0.98);
}

.service-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    font-style: italic;
}

.emergency-contact-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.emergency-contact-btn:active {
    opacity: 0.9;
}

/* Resource Content Screens */
.resource-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 2rem;
}

.resource-intro {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.resource-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(123, 160, 91, 0.1);
    border-radius: 12px;
    margin-top: 1.5rem;
}

.resource-tip i {
    color: var(--primary);
    font-size: 1.125rem;
    margin-top: 0.125rem;
}

.resource-tip p {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.subsection-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 1rem;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.topic-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.topic-card:active {
    transform: scale(0.98);
}

.topic-card i {
    font-size: 1.5rem;
    color: var(--primary);
}

.topic-card span {
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: center;
}

/* Community Types */
.community-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.community-type {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.community-type i {
    font-size: 1.25rem;
    color: var(--primary);
}

.community-type span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}
