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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #FFFFFF;
    color: #333333;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 100%;
    padding: 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    margin-bottom: 24px;
}

.header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #1E40AF;
    line-height: 1.2;
}

.cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background-color: #F5F5F5;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

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

a.card {
    text-decoration: none;
    color: inherit;
}

.card-icon {
    width: 56px;
    height: 56px;
    background-color: #E8E8E8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #1A1A1A;
    line-height: 1.3;
}

.card-subtitle {
    font-size: 14px;
    color: #8E8E93;
    line-height: 1.3;
}

.card-arrow {
    color: #3B82F6;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.footer {
    margin-top: 32px;
    padding-top: 24px;
    text-align: center;
    border-top: 1px solid #E5E5E5;
}

.footer-logo {
    font-size: 14px;
    color: #8E8E93;
    margin-bottom: 16px;
    font-weight: 500;
}

.footer-logo .ru-badge {
    display: inline-block;
    background-color: #E8E8E8;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-link {
    color: #3B82F6;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s;
}

.footer-link:active {
    opacity: 0.7;
}

.footer-disclaimer {
    font-size: 11px;
    color: #8E8E93;
    line-height: 1.4;
    max-width: 300px;
    margin: 0 auto;
}

/* Иконки SVG встроенные */
.icon-pills,
.icon-card {
    width: 40px;
    height: 40px;
}

.icon-achievement {
    width: 40px;
    height: 40px;
}

.icon-news {
    width: 40px;
    height: 40px;
}

/* Стили для страницы "Мои лекарства" */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #3B82F6;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.back-button:active {
    opacity: 0.7;
}

.back-arrow {
    font-size: 24px;
    line-height: 1;
}

.medications-header {
    margin-bottom: 32px;
}

.medications-header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #1E40AF;
    line-height: 1.2;
}

.add-medication-card {
    background-color: #F5F5F5;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.add-medication-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-medication-icon svg {
    width: 48px;
    height: 48px;
}

.add-medication-text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #1A1A1A;
}

.add-medication-plus {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: #3B82F6;
    flex-shrink: 0;
}

.medications-disclaimer {
    font-size: 11px;
    color: #8E8E93;
    line-height: 1.4;
    text-align: center;
    margin-top: auto;
    padding-bottom: 20px;
}

/* Форма добавления лекарства */
.add-medication-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow-y: auto;
    padding: 16px;
    align-items: flex-start;
    justify-content: center;
}

.add-medication-overlay.is-open {
    display: flex;
}

.add-medication-form-wrap {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 24px;
}

.add-medication-form-close {
    position: absolute;
    right: 24px;
    top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
}

.add-medication-form-close:hover {
    color: #1A1A1A;
}

.add-medication-form .form-title {
    font-size: 20px;
    font-weight: bold;
    color: #1E40AF;
    margin-bottom: 24px;
}

.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 12px;
}

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

.form-field label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    background: #fff;
    color: #1A1A1A;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #3B82F6;
}

.form-field-row .time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-field-row .time-inputs select {
    flex: 1;
    min-width: 0;
}

.time-sep {
    font-size: 18px;
    font-weight: bold;
    color: #8E8E93;
}

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

.form-actions .btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.02s;
}

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

.btn-primary {
    background: #3B82F6;
    color: #fff;
}

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

.btn-secondary {
    background: #F0F0F0;
    color: #1A1A1A;
}

.btn-secondary:active {
    opacity: 0.8;
}

/* Чат */
.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    min-height: 120px;
}

.chat-input-wrap {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid #E5E5E5;
}

.chat-textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    resize: none;
    outline: none;
}

.chat-textarea:focus {
    border-color: #3B82F6;
}

.chat-send-btn {
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #3B82F6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-send-btn:active {
    opacity: 0.9;
}

/* Список лекарств */
.medication-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.medication-item {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.medication-item__info {
    display: none;
}

.medication-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.medication-icon svg {
    width: 32px;
    height: 32px;
}

.medication-separator {
    width: 1px;
    height: 40px;
    background: #E8E8E8;
    flex-shrink: 0;
}

.medication-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.medication-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.3;
}

.medication-quantity {
    font-size: 14px;
    color: #8E8E93;
    line-height: 1.3;
}

.medication-time {
    font-size: 13px;
    color: #B13B22;
    line-height: 1.3;
}

.medication-status {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-not-taken {
    background: #B13B22;
    color: #fff;
}

