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

:root {
    --bg: #ffffff;
    --bg-subtle: #fafafa;
    --fg: #000000;
    --fg-medium: #444444;
    --fg-muted: #888888;
    --border: #eaeaea;
    --border-hover: #d4d4d4;
    --accent: #000000;
    --accent-fg: #ffffff;
    --success: #0070f3;
    --success-bg: #f0f7ff;
    --error: #e00;
    --error-bg: #fff0f0;
    --warning: #f5a623;
    --warning-bg: #fff9f0;
    --radius: 8px;
    --radius-md: 12px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

html {
    -webkit-tap-highlight-color: transparent;
}

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.medication-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.08);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: 80px;
    font-size: 15px;
}

.main-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px;
    animation: fadeIn 0.35s ease;
}

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

/* Navigation */
.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--fg-muted);
    padding: 6px 18px;
    border-radius: var(--radius);
    transition: color 0.2s ease;
    font-size: 11px;
    font-weight: 500;
    gap: 3px;
}

.nav-link.active {
    color: var(--fg);
}

.nav-link:active {
    opacity: 0.6;
}

.nav-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    letter-spacing: 0.02em;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
}

.auth-card {
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 48px 36px;
    width: 100%;
    max-width: 420px;
    animation: fadeIn 0.4s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.auth-header p {
    color: var(--fg-muted);
    font-size: 15px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--fg-medium);
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    background: var(--bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--fg);
}

.form-group input::placeholder {
    color: var(--fg-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--fg);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.btn {
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg);
    color: var(--fg);
    -webkit-tap-highlight-color: transparent;
    line-height: 1.4;
}

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

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--fg-medium);
    border-color: var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--fg-medium);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--fg-muted);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-link {
    background: transparent;
    border: none;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-medium);
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--fg);
    background: var(--bg-subtle);
    border-radius: var(--radius);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 6px;
    font-size: 16px;
    border-radius: 6px;
    color: var(--fg-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: var(--bg-subtle);
    color: var(--fg);
}

.error-message {
    background: var(--error-bg);
    color: var(--error);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(238,0,0,0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--fg-muted);
}

.auth-footer a {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-hover);
    font-weight: 500;
    transition: text-decoration-color 0.2s ease;
}

.auth-footer a:hover {
    text-decoration-color: var(--fg);
}

/* Today Page */
.today-container {
    padding-top: 4px;
}

.today-header {
    margin-bottom: 28px;
}

.today-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.today-header p {
    color: var(--fg-muted);
    font-size: 14px;
}

.medication-card {
    background: var(--fg);
    border-radius: var(--radius-md);
    padding: 48px 28px;
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--fg);
    transition: transform 0.2s ease;
}

.medication-card:hover {
    transform: translateY(-1px);
}

.medication-icon {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.medication-card h2 {
    font-size: 22px;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.medication-subtitle {
    font-size: 14px;
    opacity: 0.7;
    font-weight: 400;
}

.fed-status {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    border: 1px solid var(--border);
    animation: fadeIn 0.35s ease;
}

.fed-checkmark {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fed-status p {
    font-size: 15px;
    color: var(--fg);
    margin-bottom: 4px;
    font-weight: 500;
}

.fed-time {
    color: var(--fg-muted);
    font-size: 13px;
}

/* iOS-style Slider */
.slider-container {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 8px;
    border: 1px solid var(--border);
    animation: fadeIn 0.35s ease;
}

.slider-track {
    position: relative;
    background: var(--fg);
    border-radius: var(--radius);
    height: 52px;
    overflow: hidden;
}

.slider-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 14px;
    pointer-events: none;
    transition: opacity 0.25s ease;
    letter-spacing: 0.01em;
}

.slider-arrow {
    margin-right: 6px;
    opacity: 0.8;
    width: 16px;
    height: 16px;
}

.slider-button {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
}

.slider-button:active {
    cursor: grabbing;
}

.slider-icon {
    color: var(--fg);
    width: 18px;
    height: 18px;
}

/* Calendar Page */
.calendar-container {
    padding-top: 4px;
}

.calendar-header {
    margin-bottom: 24px;
}

.calendar-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.calendar-header p {
    color: var(--fg-muted);
    font-size: 14px;
}

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

.history-item {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.history-item:hover {
    border-color: var(--border-hover);
}

.history-item.today {
    border-color: var(--fg);
}

.history-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

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

.history-dose {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.history-dose-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    flex-shrink: 0;
    line-height: 1;
}

.history-medication {
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 2px;
}

.history-status {
    font-size: 13px;
    font-weight: 400;
}

.history-status.fed {
    color: var(--success);
}

.history-status.pending {
    color: var(--fg-muted);
}

.history-delete {
    margin-left: 8px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--error);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.history-delete:hover {
    background: var(--error-bg);
    border-color: rgba(238,0,0,0.15);
}

.loading, .no-history, .error {
    text-align: center;
    padding: 48px 24px;
    color: var(--fg-muted);
    font-size: 14px;
}

.no-history {
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-subtle) 25%, #f0f0f0 50%, var(--bg-subtle) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Schedule Page */
.schedule-container {
    padding-top: 4px;
    padding-bottom: 80px;
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.schedule-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.schedule-header h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.schedule-header p {
    color: var(--fg-muted);
    font-size: 14px;
}

.schedule-form-card {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border);
}

.schedule-form-card h2 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.schedule-form {
    display: grid;
    gap: 16px;
}

.schedule-form label {
    font-weight: 500;
    font-size: 13px;
    color: var(--fg-medium);
    display: block;
    margin-bottom: 5px;
}

.schedule-form select,
.schedule-form input[type="text"],
.schedule-form input[type="time"],
.schedule-form input[type="color"] {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 15px;
    background: var(--bg);
    color: var(--fg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.schedule-form input[type="color"] {
    height: 44px;
    padding: 4px;
    cursor: pointer;
}

.schedule-form select:focus,
.schedule-form input:focus {
    border-color: var(--fg);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
    outline: none;
}

.schedule-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.schedule-form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.schedule-form .form-status {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 13px;
    margin-top: 2px;
}

.schedule-form .form-status.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0,112,243,0.1);
}

.schedule-form .form-status.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(238,0,0,0.1);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.schedule-day-card {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.schedule-day-card:hover {
    border-color: var(--border-hover);
}

.schedule-day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 2px;
}

.schedule-day-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    margin-bottom: 3px;
}

.schedule-day-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--fg);
}

.schedule-day-subtext {
    color: var(--fg-muted);
    font-size: 13px;
    margin-top: 6px;
}

.schedule-dose-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-dose {
    background: var(--bg-subtle);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    position: relative;
    transition: border-color 0.15s ease;
}

.schedule-dose:hover {
    border-color: var(--border-hover);
}

.schedule-dose::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--dose-color, #000);
}

.dose-info {
    flex: 1;
    min-width: 0;
}

.dose-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 2px;
}

.dose-meta {
    font-size: 12px;
    color: var(--fg-muted);
    font-weight: 400;
    font-family: var(--font-mono);
}

.dose-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* Raylib-style Schedule Pills */
.schedule-section {
    margin-bottom: 24px;
}

.schedule-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.schedule-pill-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-pill {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    position: relative;
}

.schedule-pill:hover {
    border-color: var(--border-hover);
    background: var(--bg);
}

.schedule-pill:active {
    transform: scale(0.995);
}

.schedule-pill-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.08);
}

.schedule-pill-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-pill-time {
    font-size: 13px;
    color: var(--fg-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.schedule-pill-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    color: var(--fg-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.schedule-pill-delete:hover {
    background: var(--error-bg);
    color: var(--error);
}

.schedule-empty {
    font-size: 13px;
    color: var(--fg-muted);
    padding: 8px 0;
}

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

@media (min-width: 640px) {
    .modal-overlay {
        align-items: center;
        padding: 20px;
    }
}

.modal-card {
    background: var(--bg);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
    border-bottom: none;
}

@media (min-width: 640px) {
    .modal-card {
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
    }
}

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

.modal-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border);
}

.modal-footer .btn {
    flex: 1;
}

/* Modal steps */
.modal-step-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    margin-bottom: 16px;
}

/* Day checklist */
.day-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.day-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.day-check-item:hover {
    border-color: var(--border-hover);
}

.day-check-item.selected {
    background: var(--bg-subtle);
    border-color: var(--fg);
}

.day-check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--fg);
    cursor: pointer;
    flex-shrink: 0;
}

.day-check-item label {
    font-size: 15px;
    font-weight: 500;
    color: var(--fg);
    cursor: pointer;
    flex: 1;
}

/* Color palette */
.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.08);
}

.color-swatch.selected {
    border-color: var(--fg);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

.color-swatch-more {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-medium);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
}

.color-swatch-more:hover {
    border-color: var(--fg-muted);
}

/* Custom Alert / Confirm Modal */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-card {
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    width: calc(100% - 40px);
    max-width: 360px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform: scale(0.96);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.custom-modal-overlay.active .custom-modal-card {
    transform: scale(1);
    opacity: 1;
}

.custom-modal-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
    color: var(--fg);
}

.custom-modal-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--fg-medium);
    margin-bottom: 20px;
    white-space: pre-line;
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.custom-modal-footer .btn {
    min-width: 80px;
}

/* Inline name edit on pill */
.schedule-pill.editing {
    cursor: default;
}

.schedule-pill-edit {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--fg);
    font-family: inherit;
    padding: 0;
    outline: none;
}

.schedule-pill-edit::placeholder {
    color: var(--fg-muted);
}

/* Settings Page */
.settings-container {
    padding-top: 4px;
}

.settings-header {
    margin-bottom: 24px;
}

.settings-header h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.settings-card {
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h2 {
    font-size: 15px;
    margin-bottom: 14px;
    color: var(--fg);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.settings-item label {
    font-weight: 500;
    color: var(--fg);
    font-size: 14px;
}

.settings-value {
    color: var(--fg-muted);
    font-size: 13px;
    font-weight: 400;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle input:checked + .toggle-slider {
    background-color: var(--fg);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.toggle input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

.notification-status {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.notification-status.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0,112,243,0.1);
}

.notification-status.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(238,0,0,0.1);
}

.notification-status.warning {
    background: var(--warning-bg);
    color: #946500;
    border: 1px solid rgba(245,166,35,0.15);
}

/* Debug info box */
#debugInfo {
    background: var(--bg-subtle) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    color: var(--fg-medium) !important;
    font-family: var(--font-mono) !important;
    font-size: 12px !important;
}

/* Desktop layout */
@media (min-width: 768px) {
    .main-content {
        max-width: 900px;
        padding: 32px;
    }

    .nav-content {
        max-width: 900px;
    }

    .auth-container {
        background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    }

    .auth-card {
        box-shadow: 0 8px 32px rgba(0,0,0,0.08);
        border: 1px solid var(--border);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }

    .auth-card {
        padding: 32px 24px;
    }

    .medication-card {
        padding: 40px 24px;
    }

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

    .medication-card h2 {
        font-size: 20px;
    }

    .schedule-container {
        gap: 16px;
    }

    .schedule-form-card {
        padding: 18px;
    }

    .schedule-grid {
        grid-template-columns: 1fr;
    }

    .schedule-day-card {
        padding: 18px;
    }

    .schedule-pill {
        padding: 10px 12px;
    }

    .schedule-pill-name {
        font-size: 14px;
    }

    .modal-card {
        max-height: 85vh;
    }
}
